无法安装 Python 个机密包
Cannot install Python secrets package
我在 requirements.txt
文件中列出的项目中几乎没有依赖项,
requests==2.18.4
secrets==1.0.2
PyYAML==3.12
我想安装它们并调用了 virtualenv
,
里面的命令
$ pip install -r bin/requirements.txt
我收到下面提供的消息,
Collecting requests==2.18.4 (from -r bin/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting secrets==1.0.2 (from -r bin/requirements.txt (line 2))
Could not find a version that satisfies the requirement secrets==1.0.2 (from -r bin/requirements.txt (line 2)) (from versions: )
No matching distribution found for secrets==1.0.2 (from -r bin/requirements.txt (line 2))
在virtualenv
里面,我可以有提供的版本,
$ python -V
Python 3.7.2
$ pip -V
pip 19.0.3 from /Users/chaklader/PycharmProjects/Welance-Craft/env/lib/python3.7/site-packages/pip (python 3.7)
这里有什么问题?
更新
我必须删除 secrets
并更新其他依赖项:
requests==2.21.0
PyYAML==3.13
尝试自己安装软件包时,出现同样的错误。
然而,在 pypi.org 上搜索此包时,似乎最后发布的版本是 2012 年,项目主页的 link 导致几乎完全空白的网页。因此,我会假设这个包不再存在。
虽然有一个 secrets package,但它很旧(2012 年),只有一个版本,一个损坏的网站,没有任何信息。它似乎无法安装在 Python 2.7 或 3.7 上。
您可能会尝试使用 secrets
standard library that’s built-in to Python 3.6+. It’s not a package, so you don’t need to install it or add it to your requirements.txt
, simply import secrets
. If you need it for an earlier version, there does appear to be an unofficial backport。
现在 Python 2.7、3.4 和 3.5 的秘密模块有一个反向移植,名称为 python2-secrets。 (这个名字我觉得有点乱)
安装:
pip install --user python2-secrets
我在 requirements.txt
文件中列出的项目中几乎没有依赖项,
requests==2.18.4
secrets==1.0.2
PyYAML==3.12
我想安装它们并调用了 virtualenv
,
$ pip install -r bin/requirements.txt
我收到下面提供的消息,
Collecting requests==2.18.4 (from -r bin/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting secrets==1.0.2 (from -r bin/requirements.txt (line 2))
Could not find a version that satisfies the requirement secrets==1.0.2 (from -r bin/requirements.txt (line 2)) (from versions: )
No matching distribution found for secrets==1.0.2 (from -r bin/requirements.txt (line 2))
在virtualenv
里面,我可以有提供的版本,
$ python -V
Python 3.7.2
$ pip -V
pip 19.0.3 from /Users/chaklader/PycharmProjects/Welance-Craft/env/lib/python3.7/site-packages/pip (python 3.7)
这里有什么问题?
更新
我必须删除 secrets
并更新其他依赖项:
requests==2.21.0
PyYAML==3.13
尝试自己安装软件包时,出现同样的错误。
然而,在 pypi.org 上搜索此包时,似乎最后发布的版本是 2012 年,项目主页的 link 导致几乎完全空白的网页。因此,我会假设这个包不再存在。
虽然有一个 secrets package,但它很旧(2012 年),只有一个版本,一个损坏的网站,没有任何信息。它似乎无法安装在 Python 2.7 或 3.7 上。
您可能会尝试使用 secrets
standard library that’s built-in to Python 3.6+. It’s not a package, so you don’t need to install it or add it to your requirements.txt
, simply import secrets
. If you need it for an earlier version, there does appear to be an unofficial backport。
现在 Python 2.7、3.4 和 3.5 的秘密模块有一个反向移植,名称为 python2-secrets。 (这个名字我觉得有点乱)
安装:
pip install --user python2-secrets