Python 3 Pipenv无法安装获取错误

2024-10-01 07:39:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我是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``` 

Tags: installpipthetoinfoconfigeggvar
1条回答
网友
1楼 · 发布于 2024-10-01 07:39:04

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

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

因此,基本上,整个状态是由您选择的pip环境和虚拟环境组成的

如果需要,可以通过执行以下操作绕过锁定步骤:pipenv install skip-lock。在大多数情况下,pipfile.lock错误是由于pipfile中的拼写错误引起的

这是一个很好的教程,请参见此link

相关问题 更多 >