找不到满足选择要求的版本 [英] Could not find a version that satisfies the requirement for select requirements
问题描述
我当前正在尝试安装需求,并告诉我在尝试对它们进行注释时找不到该需求,这在其他情况下会发生.
I am currently trying to install a requirements and it is telling me that it is not found when I try and comment them out it happens for others.
我刚刚部署了Ubuntu 18.04
服务器.通过以下命令python3 -m venv --system-site-packages env
创建虚拟环境,但是每次尝试运行pip install -r requirements.txt
时,它都会失败
I just deployed a Ubuntu 18.04
server. Made the virtual env by the following command python3 -m venv --system-site-packages env
but every single time I try and run pip install -r requirements.txt
it fails with
Collecting apparmor==2.12 (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement apparmor==2.12 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for apparmor==2.12 (from -r requirements.txt (line 1))
如果我尝试安装,请说pip install apparmor
它告诉我
if I try and install say pip install apparmor
it tells me
Collecting apparmor
Could not find a version that satisfies the requirement apparmor (from versions: )
No matching distribution found for apparmor
但是,如果我注释掉apparmor,它会告诉我这个
But then if I comment out apparmor it tells me this
Collecting apturl==0.5.2 (from -r requirements.txt (line 2))
Could not find a version that satisfies the requirement apturl==0.5.2 (from -r requirements.txt (line 2)) (from versions: )
No matching distribution found for apturl==0.5.2 (from -r requirements.txt (line 2))
,然后随机为其他人继续.要求是在我的本地服务器上进行的,该本地服务器也是ubuntu 18
,因此不确定为什么它可以在本地服务器上工作,而不能在新的部署上工作.
and it goes on for others randomly. The requirements was made on my local which is also ubuntu 18
so unsure why this works on local but not on a new deploy.
我还确保它是pip的最新版本
I have also made sure that it's the newest version of pip
推荐答案
apparmor
和apturl
是Ubuntu软件包,如果您的代码不使用它们的代码,则可以放心地忽略它们.只需将它们从requirements.txt
中删除.如果您的代码依赖于它们,请确保通过apt
安装它们:
apparmor
and apturl
are Ubuntu packages, you can safely ignore them if your code doesn't use their code; just remove them from requirements.txt
. If your code depends on them, ensure they are installed via apt
:
apt install -y apparmor apturl && pip install -r requirements.txt
这篇关于找不到满足选择要求的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!