【问题标题】:Python 3 - Pipenv Can't Install Getting ErrorPython 3 - Pipenv 无法安装出现错误
【发布时间】:2020-08-11 18:36:05
【问题描述】:

我是 python 新手,正在尝试安装依赖项。我知道pipenv install 安装了Pipfile.lock,这让我可以安装我需要的依赖项。以下是错误本身

['ERROR: Command errored out with exit status 1:', '     command: /Users/oscarpacheco/.local/share/virtualenvs/CS-Build-Week-1-4GOi2kZe/bin/python3.7 -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' egg_info --egg-base /private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/pip-egg-info', '         cwd: /private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/', '    Complete output (23 lines):', '    running egg_info', '    creating /private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/pip-egg-info/psycopg2.egg-info', '    writing /private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO', '    writing dependency_links to /private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt', '    writing top-level names to /private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt', "    writing manifest file '/private/var/folders/q9/fd9xx1l95xv6dcrwnqqtfhpm0000gn/T/pip-install-1j4f7p9x/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'", '    ', '    Error: pg_config executable not found.', '    ', '    pg_config is required to build psycopg2 from source.  Please add the directory', '    containing pg_config to the $PATH or specify the full executable path with the', '    option:', '    ', '        python setup.py build_ext --pg-config /path/to/pg_config build ...', '    ', "    or with the pg_config option in 'setup.cfg'.", '    ', '    If you prefer to avoid building psycopg2 from source, please install the PyPI', "    'psycopg2-binary' package instead.", '    ', "    For further information please check the 'doc/src/install.rst' file (also at", '    <https://www.psycopg.org/docs/install.html>).', '    ', '    ----------------------------------------', 'ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.']
ERROR: ERROR: Package installation failed...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:01``` 

【问题讨论】:

    标签: python python-3.x terminal pip console


    【解决方案1】:

    Pipfile.lock 不会安装所需的依赖项或软件包,而是对通过 Pipenv 安装的依赖项进行最终更新检查。

    高级的 Pipenv 用于在 python 环境中运行、安装和执行已安装的包。它还管理您的虚拟环境。

    所以基本上,整个状态由您选择的 pip 环境和 virtualenv 组成。

    如果您愿意,可以通过以下方式绕过锁定步骤:pipenv install --skip-lock。在大多数情况下,pipfile.lock 错误是由于 pipfile 中的拼写错误而发生的。

    这是一个很好的教程,看这个link

    【讨论】:

    • 感谢您的帮助!很难找到解决方案或找到一个好的问题来提出这个问题。再次感谢您
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-31
    • 1970-01-01
    • 1970-01-01
    • 2019-10-01
    • 2020-10-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多