找不到满足选择要求的版本

时间:2019-04-29 21:21:04

标签: python ubuntu pip virtualenv ubuntu-18.04

我当前正在尝试安装一项要求,它告诉我在尝试对它们进行注释时找不到该要求,这对其他人来说会发生。

我刚刚部署了Ubuntu 18.04服务器。通过以下命令python3 -m venv --system-site-packages env创建虚拟环境,但是每次我尝试运行pip install -r requirements.txt时,它都会失败

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会告诉我

Collecting apparmor
  Could not find a version that satisfies the requirement apparmor (from versions: )
No matching distribution found for apparmor

但是如果我注释掉apparmor,它会告诉我这个

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上进行的,因此不确定为什么要在本地而不是在新部署上工作。

我还确保它是pip的最新版本

1 个答案:

答案 0 :(得分:1)

apparmorapturl是Ubuntu软件包,如果您的代码不使用它们的代码,则可以放心地忽略它们。只需将它们从requirements.txt中删除即可。如果您的代码依赖于它们,请确保通过apt安装了它们:

apt install -y apparmor apturl && pip install -r requirements.txt