【问题标题】:Pipenv unable to install some dependencies (pip install works fine)Pipenv 无法安装某些依赖项(pip install 工作正常)
【发布时间】:2019-11-24 08:27:24
【问题描述】:

我有一个正在转换为 pipenv 的项目。当我第一次运行pipenv install 时,它开始正常,但多个依赖项失败。当我运行pip install -r requirements.txt 时,我没有问题。我正试图找出我可能做错了什么。

生成的 pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[requires]
python_version = "2.7"

[dev-packages]

[packages]
boto = "*"
boto3 = "*"
cssmin = "*"
dropbox = "*"
gunicorn = "*"
ipdb = "*"
libsass = "*"
marshmallow = "*"
mock = "*"
networkx = "*"
newrelic = "*"
oauth2client = "*"
pandas = "*"
psycopg2 = "*"
pygsheets = "*"
pytest = "*"
pytest-cov = "*"
pytest-pep8 = "*"
python-dotenv = "*"
redis = "*"
requests = "*"
six = "==1.10.0"
scipy = "*"
seaborn = "*"
matplotlib = "*"
python-memcached = "*"
slackclient = "*"
snowflake-sqlalchemy = "*"
sqlalchemy-redshift = "*"
sqlparse = "*"
unicodecsv = "*"
urllib3 = "==1.23"
typing = "*"
Authlib = "*"
Flask-Assets = "*"
Flask-Breadcrumbs = "*"
Flask-Cache = "*"
Flask = "*"
Flask-Session = "*"
Flask-WTF = "*"
SQLAlchemy = "*"
GitPython = "*"
XlsxWriter = "*"

我得到了错误

[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
[pipenv.exceptions.InstallError]:       editable_packages=state.installstate.editables,
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]:       keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 862, in do_install_dependencies
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, False, failed_deps_queue, retry=False)
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting aiohttp==3.5.4 (from -r /var/folders/zg/kh23lx793dv9n9wrnpnltrtw0000gn/T/pipenv-b12npo6l-requirements/pipenv-a976t3ma-requirement.txt (line 1))']
[pipenv.exceptions.InstallError]: ["DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", '  ERROR: Could not find a version that satisfies the requirement aiohttp==3.5.4 (from -r /var/folders/zg/kh23lx793dv9n9wrnpnltrtw0000gn/T/pipenv-b12npo6l-requirements/pipenv-a976t3ma-requirement.txt (line 1)) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a4, 2.3.0, 2.3.1, 2.3.2b2)', 'ERROR: No matching distribution found for aiohttp==3.5.4 (from -r /var/folders/zg/kh23lx793dv9n9wrnpnltrtw0000gn/T/pipenv-b12npo6l-requirements/pipenv-a976t3ma-requirement.txt (line 1))']

但许多其他软件包也失败了。该错误显示它使用 Python 3.7,这是我的全局版本,但我在 Python 2.7.16 shell 中运行了上述所有命令,由 pipenv 本身启动(使用pipenv shell)。即使没有 shell,因为我在 pipfile 中明确列出了 Python 版本,我希望 pipenv 安装与版本匹配的包,尽管这可能是一个错误的假设?

【问题讨论】:

    标签: python pipenv


    【解决方案1】:

    pip install -r requirements.txt 真的在使用 python 2.7 吗?运行pip -V 进行确认。 aiohttp==3.5.4 需要 Python 3.5.3+ 每 documentation

    【讨论】:

    • 我会将它添加到 OP,但是是的,这两个命令都在 2.7.16 shell 中运行。我看到 aoihttp 正在请求一个 python 3 版本,这令人费解,因为 a) shell,b) 我告诉 pipenv 我正在使用 2.7,这对我来说逻辑上说如果我正在安装包,我想要 2.7 包.
    • 看起来它可能使用了不匹配的 python 版本,它正在尝试访问该错误日志中文件路径中的 3.7
    • 我注意到了。我想我在这个问题上不清楚;我试图弄清楚为什么 pipenv 使用了错误的版本,或者我怎样才能让它使用正确的版本。
    • 也许尝试将 --two 标志添加到 pipenv 安装
    • @AndrewMcFadden 您可以使用评论部分了解有关该问题的更多信息,然后发布答案。
    猜你喜欢
    • 1970-01-01
    • 2019-02-07
    • 2013-11-20
    • 2021-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-23
    • 2019-10-19
    相关资源
    最近更新 更多