Как мне устранить ошибку установки при настройке pipenv с помощью pycharm?

#python-3.x #macos #homebrew #pipenv

#python-3.x #macos #доморощенный #pipenv

Вопрос:

Я пытаюсь использовать pipenv в Pycharm, но при попытке его настройки я получаю сообщение об ошибке.

Я нахожусь на macOS Catalina 10.15.5 (19F101)

Я установил python3.8 с помощью homebrew при запуске brew install pipenv . На самом деле, у меня есть две установки Python 3 на моем компьютере. Python 3.7, который у меня есть из установщика, и двоичный файл python 3.8, который был установлен автоматически при установке pipenv. Я перепробовал все другие онлайн-решения, и, похоже, ни одно из них не решает эту проблему:

 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('"'"'rn'"'"', '"'"'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.
  

Ответ №1:

Обычно, когда я использую pycharm, мне нравится использовать встроенный механизм в разделе настройки -> интерпретатор проекта, где вы можете вручную выполнить поиск пакета, который вы пытаетесь установить, и сделать это оттуда.

Комментарии:

1. Хорошо. Я думаю, что вы хотели снять флажок «Устанавливать пакеты из Pipfile», который я только что сделал, чтобы я мог устанавливать их по одному за раз. Теперь ошибка исчезает.