简体   繁体   English

pip 无法从 requirements.txt 中找到任何包

[英]pip fails to find any packages from requirements.txt

I have a requirements.txt file with following packages listed:我有一个requirements.txt文件,其中列出了以下软件包:

appdirs==1.4.3
APScheduler==3.3.1
asn1crypto==0.22.0
bcrypt==3.1.3
boto3==1.4.4
botocore==1.5.72

When I do a pip install -q -U -r requirements.txt ;当我执行pip install -q -U -r requirements.txt I receive following error:我收到以下错误:

Could not find a version that satisfies the requirement appdirs==1.4.3 (from -r requirements.txt (line 1)) (from versions: )找不到满足 appdirs==1.4.3 要求的版本(来自 -r requirements.txt(第 1 行))(来自版本:)
No matching distribution found for appdirs==1.4.3 (from -r requirements.txt (line 1))找不到 appdirs==1.4.3 的匹配发行版(来自 -r requirements.txt(第 1 行))

But, the following works:但是,以下工作:

$ pip install appdirs
Collecting appdirs
  Downloading appdirs-1.4.3-py2.py3-none-any.whl
Installing collected packages: appdirs
Successfully installed appdirs-1.4.3

Once I had manually installed appdirs, I tried running from requirements again:手动安装 appdirs 后,我尝试再次从需求运行:

$ pip install -q -U -r requirements.txt
  Could not find a version that satisfies the requirement APScheduler==3.3.1 (from -r requirements.txt (line 2)) (from versions: )
No matching distribution found for APScheduler==3.3.1 (from -r requirements.txt (line 2))

I tried specifying the exact version for the next command now:我现在尝试为下一个命令指定确切的版本:

$ pip install APScheduler==3.3.1           
Collecting APScheduler==3.3.1
  Downloading APScheduler-3.3.1-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 2.8MB/s 
Collecting tzlocal>=1.2 (from APScheduler==3.3.1)
  Downloading tzlocal-1.4.tar.gz
Collecting funcsigs; python_version == "2.7" (from APScheduler==3.3.1)
  Downloading funcsigs-1.0.2-py2.py3-none-any.whl
Collecting six>=1.4.0 (from APScheduler==3.3.1)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting pytz (from APScheduler==3.3.1)
  Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |████████████████████████████████| 491kB 2.2MB/s 
Requirement already satisfied: setuptools>=0.7 in ./.env/lib/python2.7/site-packages (from APScheduler==3.3.1)
Collecting futures; python_version == "2.7" (from APScheduler==3.3.1)
  Downloading futures-3.1.1-py2-none-any.whl
Building wheels for collected packages: tzlocal
  Running setup.py bdist_wheel for tzlocal ... done
  Stored in directory: $HOME/.cache/pip/wheels/dc/d6/f0/84194ccbdd3e2551bdb207e1fc1925efd32956c5767328103b
Successfully built tzlocal
Installing collected packages: pytz, tzlocal, funcsigs, six, futures, APScheduler
Successfully installed APScheduler-3.3.1 funcsigs-1.0.2 futures-3.1.1 pytz-2017.2 six-1.11.0 tzlocal-1.4

How is pip not able to find the packages if specifying the requirements file?如果指定requirements文件,pip 怎么找不到包? And why does it keep finding the same packages without it?为什么在没有它的情况下它会继续找到相同的包?

PS: Everything is being done inside a virtualenv named .env . PS:一切都在名为.envvirtualenv .env


$ pip -V
pip 9.0.1 from $PWD/.env/lib/python2.7/site-packages (python 2.7)
$ python -V
Python 2.7.13
$ which python
$PWD/.env/bin/python

Doing a pip --verbose command gives:执行pip --verbose命令给出:

Collecting asn1crypto==0.22.0 (from -r requirements.txt (line 3))
  1 location(s) to search for versions of asn1crypto:
  * https://pip.<domain>/asn1crypto/
  Getting page https://pip.<domain>/asn1crypto/
  Looking up "https://pip.<domain>/asn1crypto/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pip.<domain>
  "GET /asn1crypto/ HTTP/1.1" 303 0
  Status code 303 not in [200, 203, 300, 301]
  Looking up "https://pip.<domain>/simple/asn1crypto/" in the cache
  No cache entry available
  "GET /simple/asn1crypto/ HTTP/1.1" 303 0
  Status code 303 not in [200, 203, 300, 301]
  Starting new HTTP connection (1): pypi.python.org
  "GET /simple/asn1crypto/ HTTP/1.1" 403 16
  Could not fetch URL https://pip.<domain>/asn1crypto/: 403 Client Error: SSL is required for url: http://pypi.python.org/simple/asn1crypto/ - skipping
  Could not find a version that satisfies the requirement asn1crypto==0.22.0 (from -r requirements.txt (line 3)) (from versions: )
Cleaning up...
No matching distribution found for asn1crypto==0.22.0 (from -r requirements.txt (line 3))

where https://pip.<domain> is our custom hosted pypi-server layer .其中https://pip.<domain>是我们自定义托管的pypi-server 层

You need to set the fallback_url on your pypi server to an https URL because pypi.python.org now only allows https requests.您需要将 pypi 服务器上的fallback_url设置为https URL,因为pypi.python.org现在只允许 https 请求。 See this link (python mailing list) for more information.有关更多信息,请参阅此链接(python 邮件列表)

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

相关问题 pip 无法从 requirements.txt 安装包 - pip fails to install packages from requirements.txt 使用 pip 命令从 requirements.txt 升级 python 包 - Upgrade python packages from requirements.txt using pip command 可以从requirements.txt递归地pip安装包 - Can pip install packages recursively from requirements.txt Requirements.txt中的点子分组 - pip group packages in requirements.txt 解析 requirements.txt 并安装 requirements.txt 中指定的包是否与 pip install -r requirements.txt 相同? - Is parsing the requirements.txt and install packages specified in requirements.txt same as pip install -r requirements.txt? 从requirements.txt安装选定的软件包 - Installing selected packages from requirements.txt 为什么 pip install requirements.txt 安装额外的包? - Why does pip install requirements.txt install extra packages? 找不到`pip install -r requirements.txt`安装的软件包 - Packages installed by `pip install -r requirements.txt` are not found 如何根据本地目录中的 requirements.txt 文件使用 pip 安装软件包? - How can I install packages using pip according to the requirements.txt file from a local directory? PIP 随机失败 &#39;Could not find a version that satisfactory of the requirements&#39; with the same requirements.txt - PIP randomly fails 'Could not find a version that satisfies the requirement' with the same requirements.txt
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM