正在将requirements.txt安装到虚拟环境中



我有一个包含脚本*.py的目录,需要在另一台包含不同版本模块的计算机上编译。我打开了该目录中的终端,并创建了需求:

pip freeze > requirements.txt 

然后我创建了一个虚拟环境,并尝试从requirements.txt 安装软件包

virtualenv compilation
source compilation/bin/activate
python3.6 -m pip install -r requirements.txt

最后是这样的:

ERROR: Cannot install babel==2.7.0, gitsome==0.8.4 and pytz==2021.1 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested pytz==2021.1
babel 2.7.0 depends on pytz>=2015.7
gitsome 0.8.4 depends on pytz<2017.0 and >=2016.3
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

为什么当这些包在非虚拟Python 3.6中工作时会发生冲突?请问该怎么办?

babel和gitsome升级后

ERROR: Cannot install babel==2.7.0, gitsome==0.8.4, pandas==1.1.5 and pytz==2016.10 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested pytz==2016.10
babel 2.7.0 depends on pytz>=2015.7
gitsome 0.8.4 depends on pytz<2017.0 and >=2016.3
pandas 1.1.5 depends on pytz>=2017.2
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

降级pytz

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pandas 1.1.5 requires pytz>=2017.2, but you have pytz 2015.7 which is incompatible.
gitsome 0.8.4 requires pytz<2017.0,>=2016.3, but you have pytz 2015.7 which is incompatible.
Successfully installed pytz-2016.10
Removed build tracker: '/tmp/pip-req-tracker-8c5_ezeo'

您可能需要尝试降级pytz

pip install -Iv pytz==2017.0

或升级babel和gitsome

sudo pip install babel --upgrade
sudo pip install gitsome --upgrade

最新更新