Pipenv: AttributeError: 'NoneType'オブジェクトには、新しいpipfileを作成するときに属性 'pythons'がありません

作成日 2019年01月12日  ·  20コメント  ·  ソース: pypa/pipenv

問題の説明

pipenv install --verboseを実行しようとしましたが、失敗しました。

期待される結果

virtualenvがセットアップされ、pipfileが作成され、エラーがポップアップしないことを期待していました。

実際の結果( --verbose

Creating a virtualenv for this project…
Pipfile: /Users/******/Pipfile
Using /usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7 (3.7.2) to create virtualenv…
⠏ Creating virtual environment...Already using interpreter /usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7
Using real prefix '/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/******/.local/share/virtualenvs/******/bin/python3.7
Also creating executable in /Users/******/.local/share/virtualenvs/******/bin/python
Installing setuptools, pip, wheel...
done.

✔ Successfully created virtual environment!
Virtualenv location: /Users/******/.local/share/virtualenvs/******/
Creating a Pipfile for this project…
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==2018.11.26', 'console_scripts', 'pipenv')()
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1741, in do_install
    pypi_mirror=pypi_mirror,
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py", line 609, in ensure_project
    validate=validate, skip_requirements=skip_requirements, system=system
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py", line 320, in ensure_pipfile
    project.create_pipfile(python=python)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py", line 726, in create_pipfile
    required_python = self.which("python", self.virtualenv_location)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py", line 1083, in which
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py", line 1083, in <genexpr>
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 67, in which
    return self.system_path.which(exe)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 156, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init e10e89ae41c3b673beaf8c9439cf2f48dc63d342>", line 21, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 147, in get_pythons
    pythons.update(p.pythons)
AttributeError: 'NoneType' object has no attribute 'pythons'

複製する手順

複製する手順を提供します(通常、少なくともコマンドとPipfileが含まれます)。

pyenvがインストールされているmacOSではpipenv install --verbose

$ pipenv --support

Pipenvバージョン: '2018.11.26'

Pipenvの場所: '/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv'

Pythonの場所: '/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7'

見つかったPythonインストール:

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==2018.11.26', 'console_scripts', 'pipenv')()
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/cli/command.py", line 146, in cli
    get_pipenv_diagnostics()
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/help.py", line 33, in get_pipenv_diagnostics
    python_paths = finder.find_all_python_versions()
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 122, in find_all_python_versions
    python_version_dict = getattr(self.system_path, "python_version_dict")
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 156, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init bc0428324c02997e1f41dd7925001d6ab66b13b8>", line 21, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 147, in get_pythons
    pythons.update(p.pythons)
AttributeError: 'NoneType' object has no attribute 'pythons'
Vendored Dependencies

最も参考になるコメント

同様の問題があり、私にとっての問題は、macOSがpyenvのversionsフォルダーに.DS_Storeファイルを作成し、Pipfileが窒息していたことでした。 簡単な回避策は、単にそのファイルを削除することです。

rm /Users/YOUR_USER_NAME/.pyenv/versions/.DS_Store

全てのコメント20件

pythonfindersのバグのようです。

こんにちは、素晴らしいツールをありがとう。 同じ問題が発生したようです。 Unixシステムで新しいパッケージを作成できる以前のバージョンのpfpipenvはありますか?

Creating a Pipfile for this project…
Traceback (most recent call last):
  File "<user>.pyenv/versions/original/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/cli/command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/core.py", line 1741, in do_install
    pypi_mirror=pypi_mirror,
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/core.py", line 609, in ensure_project
    validate=validate, skip_requirements=skip_requirements, system=system
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/core.py", line 320, in ensure_pipfile
    project.create_pipfile(python=python)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/project.py", line 726, in create_pipfile
    required_python = self.which("python", self.virtualenv_location)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/project.py", line 1083, in which
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/project.py", line 1083, in <genexpr>
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 67, in which
    return self.system_path.which(exe)
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 54, in system_path
    ignore_unsupported=self.ignore_unsupported,
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 451, in create
    ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 196, in _setup_pyenv
    version_glob_path="versions/*", ignore_unsupported=self.ignore_unsupported
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 156, in create
    sort_function=sort_function, version_glob_path=version_glob_path)
  File "<attrs generated init bd56ac5da1059b9f7a032263a61829782162e769>", line 21, in __init__
  File "<user>.pyenv/versions/3.6.7/envs/original/lib/python3.6/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 147, in get_pythons
    pythons.update(p.pythons)
AttributeError: 'NoneType' object has no attribute 'pythons'

OSX10.14.3でpyenv1.2.9(homebrew経由)とpipenv 2018.11.26(homebrew経由)を使用して、同じ問題が発生していると思います。 すでにセットアップされたvenvを使用していたという点で違いがあります(pyenvを使用)。

`> $ pipenv --support
礼儀通知:Pipenvは仮想環境内で実行されているため、プロジェクト用に独自の環境を作成するのではなく、自動的にその環境を使用します。 PIPENV_IGNORE_VIRTUALENVS = 1を設定して、pipenvにその環境を無視させ、代わりに独自の環境を作成させることができます。 PIPENV_VERBOSITY = -1を設定して、この警告を抑制することができます。

$ pipenv --support

Pipenvバージョン: '2018.11.26'

Pipenvの場所: '/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv'

Pythonの場所: '/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7'

見つかったPythonインストール:

トレースバック(最後の最後の呼び出し):
get_versionsのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行112
バージョン= PythonVersion.parse(p.name)
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行359、解析中
version_dict = parse_python_version(str(version))
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/utils.py"、行86、parse_python_version
InvalidPythonVersion( "%sはPythonバージョンではありません"%version_str)を発生させます
pipenv.vendor.pythonfinder.exceptions.InvalidPythonVersion: venv372はPythonバージョンではありません

上記の例外の処理中に、別の例外が発生しました。

トレースバック(最後の最後の呼び出し):
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/pipenv"、11行目
load_entry_point( 'pipenv == 2018.11.26'、 'console_scripts'、 'pipenv')()
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行764、__ call__
self.main( args、* kwargs)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行717、メイン
rv = self.invoke(ctx)
ファイル「/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py」、1114行目
Command.invoke(self、ctx)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行956、invoke
ctx.invoke(self.callback、 * ctx.params)を返しますファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行555、invokeコールバックを返す( args、 * kwargs)new_funcのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py"、64行目ctx.invoke(f、obj、* args、* kwargs)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行555、invoke
コールバックを返す( args、* kwargs)
new_funcのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py"、行17
f(get_current_context()、 args、* kwargs)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/cli/command.py"、146行目、cli
get_pipenv_diagnostics()
get_pipenv_diagnosticsのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/help.py"、33行目
python_paths = finder.find_all_python_versions()
find_all_python_versionsのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py"、行122
python_version_dict = getattr(self.system_path、 "python_version_dict")
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py"、54行目、system_path
ignore_unsupported = self.ignore_unsupported、
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py"、行451、作成中
ignore_unsupported = ignore_unsupported、
ファイル ""、38行目、__ init__
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py"、行116、__ attrs_post_init__
self._setup_pyenv()
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py"、行196、_setup_pyenv
version_glob_path = "versions / *"、ignore_unsupported = self.ignore_unsupported
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行156、作成中
sort_function = sort_function、version_glob_path = version_glob_path)
ファイル ""、17行目、__ init__
get_versionsのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行114
entry = next(iter(version_path.find_all_python_versions())、None)
AttributeError: 'NoneType'オブジェクトには属性がありません 'find_all_python_versions'`

興味深いことに、バージョン3.7.2は正しいとはいえ、(無効な)名前が「venv372」のPythonを調べていることに気付きました。これは、pyenvを使用してvenvに名前を付けたものではありません。

もう少し遊んだ後、 pipenv installを使用してvenvを作成するときにも、機能しないことがわかりました。例:

`> $ pipenv install
このプロジェクトのvirtualenvを作成しています…
Pipfile:/ Users / will / Documents / src / xxxx-xxxxxx / Pipfile
/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7(3.7.2)を使用してvirtualenvを作成…
⠹仮想環境を作成しています...すでにインタプリタ/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7を使用しています
実際のプレフィックスを使用する '/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7'
/Users/will/.local/share/virtualenvs/xxxx-xxxxxx-wtCyu9vb/bin/python3.7にある新しいPython実行可能ファイル
また、/ Users / will / .local / share / virtualenvs / xxxx-xxxxxx-wtCyu9vb / bin / pythonに実行可能ファイルを作成します
setuptools、pip、wheelをインストールしています...
終わり。

✔仮想環境の作成に成功しました!
Virtualenvの場所:/Users/will/.local/share/virtualenvs/xxxx-xxxxxx-wtCyu9vb
Pipfileの代わりにrequirements.txtが見つかりました! 変換中…
トレースバック(最後の最後の呼び出し):
get_versionsのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行112
バージョン= PythonVersion.parse(p.name)
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行359、解析中
version_dict = parse_python_version(str(version))
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/utils.py"、行86、parse_python_version
InvalidPythonVersion( "%sはPythonバージョンではありません"%version_str)を発生させます
pipenv.vendor.pythonfinder.exceptions.InvalidPythonVersion:xxxx-xxxxxx-3.7.2はPythonバージョンではありません

上記の例外の処理中に、別の例外が発生しました。

トレースバック(最後の最後の呼び出し):
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/bin/pipenv"、11行目
load_entry_point( 'pipenv == 2018.11.26'、 'console_scripts'、 'pipenv')()
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行764、__ call__
self.main( args、* kwargs)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行717、メイン
rv = self.invoke(ctx)
ファイル「/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py」、1137行目
return _process_result(sub_ctx.command.invoke(sub_ctx))
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行956、invoke
ctx.invoke(self.callback、 * ctx.params)を返しますファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行555、invokeコールバックを返す( args、 * kwargs)new_funcのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py"、64行目ctx.invoke(f、obj、* args、* kwargs)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/core.py"、行555、invoke
コールバックを返す( args、* kwargs)
new_funcのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py"、行17
f(get_current_context()、 args、* kwargs)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/cli/command.py"、254行目、インストール中
editable_packages = state.installstate.editables、
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py"、行1741、do_install
pypi_mirror = pypi_mirror、
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py"、行609、ensure_project
validate = validate、skip_requirements = skip_requirements、system = system
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/core.py"、行294、ensure_pipfile
project.create_pipfile(python = python)
create_pipfileのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py"、行726
required_python = self.which( "python"、self.virtualenv_location)
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py"、行1083、
result = next(iter(filter(None、(find(finder)for finder in self.finders)))、None)
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/project.py"、行1083、
result = next(iter(filter(None、(find(finder)for finder in self.finders)))、None)
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py"、67行目
self.system_path.which(exe)を返します
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py"、54行目、system_path
ignore_unsupported = self.ignore_unsupported、
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py"、行451、作成中
ignore_unsupported = ignore_unsupported、
ファイル ""、38行目、__ init__
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py"、行116、__ attrs_post_init__
self._setup_pyenv()
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py"、行196、_setup_pyenv
version_glob_path = "versions / *"、ignore_unsupported = self.ignore_unsupported
ファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行156、作成中
sort_function = sort_function、version_glob_path = version_glob_path)
ファイル ""、17行目、__ init__
get_versionsのファイル "/usr/local/Cellar/pipenv/2018.11.26/libexec/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py"、行114
entry = next(iter(version_path.find_all_python_versions())、None)
AttributeError: 'NoneType'オブジェクトには属性がありません 'find_all_python_versions'`

これと上記の以前のエラーについて奇妙なことに私は、 xxxx-xxxxxx-3.7.2 is not a python versionが以前に(pyenvを使用して)作成したが〜/ .pyenv / versions /から完全に削除したvenvを参照していることです。 。(シンボリックリンクと実際のvenvフォルダーの両方) pipenv installコマンドを実行する前。 上記の最初の投稿でも同様に、 venv372は、これを試していた最初のvenvに付けた最初の名前でした... venvを削除した後も、どういうわけかこれが残っているようです。 2番目の例では、pipenvが独自のvenvを作成した場合でも、pyenvで作成されたvenvの(古くてすでに削除された)名前を見つけたようです...

紛らわしいと思われる場合は申し訳ありません。

申し訳ありませんが、もう1つ更新があります。pipenvコマンドを変更して、正常に動作させることができました。 私が以前やっていたこと:
pyenv global 3.7.2
pipenv install
=失敗
pyenv global 3.7.2
pipenv install --python=~/.pyenv/versions/3.7.2/bin/python
=失敗
pyenv global 3.7.2
pipenv install --python=/Users/Will/.pyenv/versions/3.7.2/bin/python
=成功! pythonfinderはおそらくチルダパスが好きではないようですか?

同様の問題があり、私にとっての問題は、macOSがpyenvのversionsフォルダーに.DS_Storeファイルを作成し、Pipfileが窒息していたことでした。 簡単な回避策は、単にそのファイルを削除することです。

rm /Users/YOUR_USER_NAME/.pyenv/versions/.DS_Store

@WillAydああ、私は.DS_Storeファイルを~/.pyenv/versions/に持っていて、それが問題になることを望んでいましたが、それを削除してもうまくいきませんでした。 それを削除した後、これが私のpipenv --three出力です:

callen<strong i="10">@hostname</strong> ~/Desktop/test $ pipenv --version
pipenv, version 2018.11.26
callen<strong i="11">@hostname</strong> ~/Desktop/test $ pipenv --three
['Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 160, in _create_subprocess\n    combine_stderr=combine_stderr)\n', '  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 134, in _spawn_subprocess\n    return subprocess.Popen(cmd, **options)\n', '  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__\n    restore_signals, start_new_session)\n', '  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child\n    raise child_exception_type(errno_num, err_msg, err_filename)\n', "FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/pythonz': '/usr/local/bin/pythonz'\n", '\nDuring handling of the above exception, another exception occurred:\n\n', 'Traceback (most recent call last):\n', '  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/contextmanagers.py", line 150, in spinner\n    yield _spinner\n', '  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 314, in run\n    write_to_stdout=True\n', '  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 162, in _create_subprocess\n    sys.stderr.write("Error %s while executing command %s", exc, " ".join(cmd._parts))\n', 'TypeError: write() takes exactly one argument (3 given)\n']
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 160, in _create_subprocess
    combine_stderr=combine_stderr)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 134, in _spawn_subprocess
    return subprocess.Popen(cmd, **options)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/pythonz': '/usr/local/bin/pythonz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 208, in cli
    clear=state.clear,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 574, in ensure_project
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 494, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 114, in find_python_version
    major=major, minor=minor, patch=patch, pre=pre, dev=dev, arch=arch, name=name
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 396, in find_python_version
    ver = next(iter(self.get_pythons(sub_finder)), None)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 279, in get_pythons
    reverse=True
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 277, in <genexpr>
    (p for p in self._filter_paths(finder) if p.is_python),
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in <genexpr>
    pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/utils.py", line 251, in unnest
    for el in target:
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 264, in <genexpr>
    pth for pth in unnest(finder(p) for p in self.path_entries if p is not None)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/mixins.py", line 121, in find_python_version
    for child in unnest(self.pythons.values())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 531, in pythons
    for path, entry in self.children.items():
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 501, in children
    for child_key, child_val in self._gen_children():
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 493, in _gen_children
    entry = PathEntry.create(path=child, **pass_args)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 575, in create
    _new = cls(**creation_args)
  File "<attrs generated init 006bcb916ef7666bd69c45d2bf2e5793db25a453>", line 16, in __init__
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 518, in get_py_version
    py_version = PythonVersion.from_path(path=self, name=self.name)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 395, in from_path
    py_version = get_python_version(path.path.absolute().as_posix())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pythonfinder/utils.py", line 68, in get_python_version
    combine_stderr=False, write_to_stdout=False)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 314, in run
    write_to_stdout=True
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/vistir/misc.py", line 162, in _create_subprocess
    sys.stderr.write("Error %s while executing command %s", exc, " ".join(cmd._parts))
TypeError: write() takes exactly one argument (3 given)
callen<strong i="12">@hostname</strong> ~/Desktop/test $ 

この出力は元の問題とは異なって見えますが、pipenvを使用してvirtualenvsを作成することで何か厄介なことが起こっているようです。 去年から私のためにバストされています:(

私の場合、 .pyenv/versions/ディレクトリにzipファイルがありました(長い話:私のコンパイラは1台のマシンで壊れているので、新しいPythonバージョンをコピーする必要があります)。

zipファイルを削除することはそれが機能することを意味します。

誰かがグーグルからここにたどり着いた場合、私はこの問題を抱えていました、そしてその理由は私の.pyenv/versionsフォルダのシンボリックリンク

versionsディレクトリでpyenvが期待するもの以外のものを実行すると、予期しない動作が発生するようです。 :スマイリー:

~/.pyenv/versionsフォルダーは一見問題ないように見えましたが、これに遭遇しました。 このスレッドの提案に従って、もう少し掘り下げてみたところ、Pythonバージョンの1つにbin/フォルダーがなく、おそらくインストールが失敗していることがわかりました。 そのフォルダを削除/インストールすると、pipenvの問題が修正されました。

psその特定のバージョン(私が使用しようとしていたバージョンではありませんでした)に何か問題があると私が理解した方法は、 3.6.3フォルダーが他のすべてのフォルダーよりもわずかに小さいこと

pythonfinder動作しているときに同じ問題が発生しましたが、いずれも機能していないようです。

私は私を助けた回避策を見つけました:

  1. ~/.local/bin/ (またはそれが配置されている場所)からpipenv実行可能ファイルを削除します
  2. pyenvを使用して、新しいpython 3.6.5をダウンロードし、それをグローバルPythonバージョンとして設定します
  3. その中にpipenvをインストールし、 Pipfileから仮想環境を再構築します

何が問題だったのかはまだわかりませんが、これは私が仕事を成し遂げるのに役立ちました

@dammitjimのソリューションの詳細な説明。 私にとって、この問題は私の~/.pyenv/versionsフォルダのシンボリックリンクが切れていることが原因

犯人のシンボリックリンク:

my-test-venv -> ~/.pyenv/versions/3.6.0/envs/my-test-venv

virtualenvプラグインをpyenvに追加したときに、問題が発生したと思います。 バージョンフォルダにシンボリックリンクを作成しました。

実行時に以下のエラーが発生します:

pipenv --python 3.7.4

ここで、python 3.7.4は、pyenvによって設定されたグローバルpythonです。

ATN-M-user:repo_test user$ pipenv install
Creating a Pipfile for this project…
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 112, in get_versions
    version = PythonVersion.parse(p.name)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 359, in parse
    version_dict = parse_python_version(str(version))
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/utils.py", line 86, in parse_python_version
    raise InvalidPythonVersion("%s is not a python version" % version_str)
pipenv.vendor.pythonfinder.exceptions.InvalidPythonVersion: .DS_Store is not a python version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/cli/command.py", line 235, in install
    retcode = do_install(
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/core.py", line 1734, in do_install
    ensure_project(
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/core.py", line 608, in ensure_project
    ensure_pipfile(
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/core.py", line 320, in ensure_pipfile
    project.create_pipfile(python=python)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/project.py", line 726, in create_pipfile
    required_python = self.which("python", self.virtualenv_location)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/project.py", line 1083, in which
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/project.py", line 1083, in <genexpr>
    result = next(iter(filter(None, (find(finder) for finder in self.finders))), None)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 67, in which
    return self.system_path.which(exe)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 50, in system_path
    self._system_path = SystemPath.create(
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 445, in create
    return cls(
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 194, in _setup_pyenv
    self.pyenv_finder = PythonFinder.create(
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 155, in create
    return cls(root=root, ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 2084c70614ac964875c38eeb8eca94989e0b8cbd>", line 17, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 114, in get_versions
    entry = next(iter(version_path.find_all_python_versions()), None)
AttributeError: 'NoneType' object has no attribute 'find_all_python_versions'

上記から、これはすでに解決されているか、.pyenv / versions / XXX / bin /ディレクトリのシンボリックリンクが原因であるように思われます

今日、pyenv、virtualenv、pipenvなどすべてを再インストールしましたが、まだ問題が発生しています。 したがって、古いバージョンが原因ではありません。

パスでPythonバージョンを明示的に設定することで動作させました:

pipenv --python〜 / .pyenv / versions / 3.7.4 / bin / python3.7

ベンダーのpythonfinderパッケージにはバグがあります: https

pythonfinderパッチを適用することで機能しました。 バグを回避するために行ったことを含め、そのチケットにさらに多くのことを書きました。 ただし、すべての状況で機能するとは限りません。

Linuxでも同じ問題が発生しました。
〜.bashrcからeval "$(pyenv init -)"ディレクティブを削除すると、問題が解決することがわかりました。

この問題に苦しんでいる人たちに-preleaseバージョンを使用して解決されているかどうかを確認できますか? プレリリースはpip install --upgrade --pre pipenvからインストールできます

@techalchemy問題は解決したようです。 あなたの仕事に感謝します、私は最終的にそれらのrequirements.txtファイルから離れることができるように見えます。 (Ubuntu16、18およびDebian 9でチェックされ、それらすべてにpyenvを使用)

関連するメモで、次のリリース(または暫定的な日付)はいつですか?

@techalchemy名前空間パッケージに問題があるようです

Installing dependencies from Pipfile.lock (ed62ac)…
Traceback (most recent call last):
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 808, in setup_info
    self.setup_info = self.get_setup_info()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 797, in get_setup_info
    setup_info = SetupInfo.from_ireq(self.ireq)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 778, in ireq
    self.parse_ireq()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 925, in parse_ireq
    if self.requirement is not None and self._ireq.req is None:
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 485, in requirement
    self.parse_requirement()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1064, in parse_requirement
    self.parse_name()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1018, in parse_name
    name = self._parse_name_from_path()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 987, in _parse_name_from_path
    parsed_setup_cfg = self.parsed_setup_cfg
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 872, in parsed_setup_cfg
    return parse_setup_cfg(setup_content, base_dir)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 321, in parse_setup_cfg
    name, version = get_name_and_version_from_setupcfg(parser, package_dir)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 276, in get_name_and_version_from_setupcfg
    version = parse_special_directives(parser.get("metadata", "version"), package_dir)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 190, in parse_special_directives
    rv = ast_parse_attribute_from_file(path, attribute)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 939, in ast_parse_attribute_from_file
    analyzer = ast_parse_file(path)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 960, in ast_parse_file
    tree = ast.parse(read_source(path))
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/utils.py", line 1024, in read_source
    with open(path, "r", encoding=encoding) as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/me/myproject/find_namespace:/eai/training'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/.pyenv/versions/3.7.2/bin/pipenv", line 10, in <module>
    sys.exit(cli())
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/cli/command.py", line 251, in install
    site_packages=state.site_packages
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/core.py", line 2053, in do_install
    keep_outdated=keep_outdated
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/core.py", line 1308, in do_init
    pypi_mirror=pypi_mirror,
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/core.py", line 839, in do_install_dependencies
    deps_list = list(lockfile.get_requirements(dev=dev, only=requirements))
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 273, in get_requirements
    yield Requirement.from_pipfile(k, v)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2688, in from_pipfile
    r = FileRequirement.from_pipfile(name, pipfile)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1784, in from_pipfile
    arg_dict["setup_info"] = arg_dict["parsed_line"].setup_info
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 811, in setup_info
    self.setup_info = self.get_setup_info()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 821, in setup_info
    self.specifier = setup_info.version
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 423, in specifier
    self.specifiers = SpecifierSet(spec)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 468, in specifiers
    if self.requirement is not None:
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 485, in requirement
    self.parse_requirement()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1064, in parse_requirement
    self.parse_name()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1018, in parse_name
    name = self._parse_name_from_path()
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 987, in _parse_name_from_path
    parsed_setup_cfg = self.parsed_setup_cfg
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/cached_property.py", line 35, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 872, in parsed_setup_cfg
    return parse_setup_cfg(setup_content, base_dir)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 321, in parse_setup_cfg
    name, version = get_name_and_version_from_setupcfg(parser, package_dir)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 276, in get_name_and_version_from_setupcfg
    version = parse_special_directives(parser.get("metadata", "version"), package_dir)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 190, in parse_special_directives
    rv = ast_parse_attribute_from_file(path, attribute)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 939, in ast_parse_attribute_from_file
    analyzer = ast_parse_file(path)
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 960, in ast_parse_file
    tree = ast.parse(read_source(path))
  File "/Users/me/.pyenv/versions/3.7.2/lib/python3.7/site-packages/pipenv/vendor/requirementslib/models/utils.py", line 1024, in read_source
    with open(path, "r", encoding=encoding) as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/me/myproject/find_namespace:/myproject'

私は次の問題を修正しました:

brew uninstall pipenv
brew uninstall pyenv
sudo rm -rf .pyenv               # sudo is required somehow

brew install pipenv
pipenv install                      # works!

私のエラーは次のとおりです。

$ pipenv install
Warning: the environment variable LANG is not set!
We recommend setting this in ~/.profile (or equivalent) for proper expected behavior.
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/cli/command.py", line 235, in install
    retcode = do_install(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 1734, in do_install
    ensure_project(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 570, in ensure_project
    ensure_virtualenv(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 494, in ensure_virtualenv
    python = ensure_python(three=three, python=python)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 397, in ensure_python
    path_to_python = find_a_system_python(python)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 360, in find_a_system_python
    python_entry = finder.find_python_version(line)
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 113, in find_python_version
    return self.system_path.find_python_version(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 50, in system_path
    self._system_path = SystemPath.create(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 445, in create
    return cls(
  File "<attrs generated init 75e45f144e3d5510d54dd5fca6730b98fa0220a9>", line 38, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 116, in __attrs_post_init__
    self._setup_pyenv()
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 194, in _setup_pyenv
    self.pyenv_finder = PythonFinder.create(
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 155, in create
    return cls(root=root, ignore_unsupported=ignore_unsupported,
  File "<attrs generated init 0e1c3b545161b8d7ddefe5b30dc455370bfb916f>", line 21, in __init__
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/vendor/pythonfinder/models/python.py", line 147, in get_pythons
    pythons.update(p.pythons)
AttributeError: 'NoneType' object has no attribute 'pythons'
このページは役に立ちましたか?
0 / 5 - 0 評価