我正在尝试在Pycharm中使用pipenv,但是在尝试设置它时出现错误。
我正在使用macOS Catalina 10.15.5(19F101)
运行brew install pipenv
时,我用自制软件安装了python3.8。实际上,我的机器上安装了两个Python 3。我从安装程序中获得的Python 3.7和在安装pipenv时自动安装的python 3.8二进制文件。我在网上尝试了所有其他解决方案,但似乎没有一个可以解决此问题:
pipenv.patched.notpip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info
这是我的问题的屏幕截图:
这在“命令输出”部分中显示:
Virtualenv already exists!
Removing existing virtualenv…
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Creating a virtualenv for this project…
Pipfile: /Users/xxxxxxxxxx/Documents/Programming/myproject/Pipfile
Using /usr/local/bin/python3 (3.8.5) to create virtualenv…
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...created virtual environment CPython3.8.5.final.0-64 in 2397ms
creator CPython3Posix(dest=/Users/xxxxxxxxxx/.local/share/virtualenvs/myproject--T_4UUiG, clear=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/xxxxxxxxxx/Library/Application Support/virtualenv)
added seed packages: pip==20.2.1, setuptools==49.2.1, wheel==0.34.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
✔ Successfully created virtual environment!
Virtualenv location: /Users/xxxxxxxxxx/.local/share/virtualenvs/myproject--T_4UUiG
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
⠋ Locking...
Building requirements...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
(Tons of locking messages)
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
Resolving dependencies...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
(Tons of locking messages)
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...
⠧ Locking...
⠇ Locking...
⠏ Locking...
⠋ Locking...
⠙ Locking...
⠹ Locking...
⠸ Locking...
⠼ Locking...
⠴ Locking...
⠦ Locking...✘ Locking Failed!
ERROR:pip.subprocessor:Command errored out with exit status 1:
command: /Users/xxxxxxxxxx/.local/share/virtualenvs/myproject--T_4UUiG/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/setup.py'"'"'; __file__='"'"'/private/var/folders/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/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/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/pip-egg-info
cwd: /private/var/folders/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/
Complete output (10 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/setup.py", line 5, in <module>
import toolz
File "/private/var/folders/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/toolz/__init__.py", line 3, in <module>
from .functoolz import *
File "/private/var/folders/tq/0dy10hb513z0slf8n7gcspyw0000gn/T/pip-resolver-pjxum28o/toolz/toolz/functoolz.py", line 501
f.__name__ for f in reversed((self.first,) + self.funcs),
^
SyntaxError: Generator expression must be parenthesized
----------------------------------------
Traceback (most recent call last):
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 807, in <module>
main()
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 802, in main
_main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, parsed.write,
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 785, in _main
resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 746, in resolve_packages
results, resolver = resolve(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 728, in resolve
return resolve_deps(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 1378, in resolve_deps
results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 1093, in actually_resolve_deps
resolver.resolve()
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 808, in resolve
results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 180, in resolve
has_changed, best_matches = self._resolve_one_round()
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 268, in _resolve_one_round
their_constraints.extend(self._iter_dependencies(best_match))
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 383, in _iter_dependencies
dependencies = self.repository.get_dependencies(ireq)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 226, in get_dependencies
legacy_results = self.get_legacy_dependencies(ireq)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 347, in get_legacy_dependencies
results, ireq = self.resolve_reqs(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 303, in resolve_reqs
results = resolver._resolve_one(reqset, ireq)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/legacy_resolve.py", line 339, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/legacy_resolve.py", line 287, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 508, in prepare_linked_requirement
abstract_dist = _get_prepared_distribution(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/distributions/sdist.py", line 40, in prepare_distribution_metadata
self.req.prepare_metadata()
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 564, in prepare_metadata
self.metadata_directory = self._generate_metadata()
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 538, in _generate_metadata
return generate_metadata_legacy(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/build/metadata_legacy.py", line 115, in generate_metadata
call_subprocess(
File "/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/utils/subprocess.py", line 242, in call_subprocess
raise InstallationError(exc_msg)
pipenv.patched.notpip._internal.exceptions.InstallationError: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
答案 0 :(得分:1)
通常,当我使用pycharm时,我喜欢在首选项->项目解释器下使用内置机制,您可以在其中手动搜索要安装的软件包并从那里进行安装。