简体   繁体   English

为什么pip安装colorama〜= 0.3安装colorama-0.4.0

[英]Why pip install colorama~=0.3 installs colorama-0.4.0

I have trouble installing my project which depends on Colorama. 我在安装依赖Colorama的项目时遇到问题。 In the setup.py , I specified: setup.py ,我指定了:

'colorama ~= 0.3'

But I'm surprised to see that the version 0.4 is installed (this version is new). 但是我很惊讶地看到安装了版本0.4(此版本是新的)。

How to reproduce? 如何繁殖? Create and activate a virtualenv and run: 创建并激活一个virtualenv并运行:

pip install colorama~=0.3

And then look at the logs or run: 然后查看日志或运行:

pip list

What's wrong with the ~= operator? ~=运算符有什么问题?

note: I'm using pip v18.1 and setuptools v40.4.3 注意:我使用的是pip v18.1和setuptools v40.4.3

The operator ~= means "compatible release". 运算符~=表示“兼容版本”。 When using semantic versioning a compatible version is such that the first number in the sequence is the same (number 0 in this case). 使用语义版本控制时 ,兼容版本应确保序列中的第一个数字相同(在这种情况下为数字0)。

From the link above: 从上面的链接:

Given a version number MAJOR.MINOR.PATCH, increment the: 给定版本号MAJOR.MINOR.PATCH,增加:

MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. 进行不兼容的API更改时为MAJOR版本 ,以向后兼容的方式添加功能时为MINOR版本,而向后兼容的错误修复时为PATCH版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM