web-dev-qa-db-ja.com

Pipenv Install RuntimeError:場所が作成も指定もされていません

Pipenvを使用してプロジェクトの依存関係を管理しています。今までは問題なく動いていました。今私はbootstrap pipenv installと私は次のエラーを受け取ります:

❯ pipenv install --dev --skip-lock
Creating a virtualenv for this project…
Pipfile: /Users/user/project/Pipfile
Using /usr/bin/python3 (3.7.3) to create virtualenv…
⠧ Creating virtual environment...created virtual environment CPython3.7.3.final.0-64 in 399ms
  creator CPython3Posix(dest=/Users/user/.local/share/virtualenvs/sql_runner-ABIm84c6, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/user/Library/Application Support/virtualenv/seed-app-data/v1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

✔ Successfully created virtual environment!
Virtualenv location: /Users/user/.local/share/virtualenvs/sql_runner-ABIm84c6
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 579, in ensure_project
    path_to_python = which("python") or which("py")
  File "/usr/local/Cellar/pipenv/2018.11.26_4/libexec/lib/python3.8/site-packages/pipenv/core.py", line 108, in which
    raise RuntimeError("location not created nor specified")
RuntimeError: location not created nor specified

Pipfileは次のとおりです

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest     = "==4.6.3"
flake8     = "==3.7.7"
autopep8   = "==1.4.4"
pytest-cov = "==2.7.1"
moto       = "==1.3.13"
Sphinx     = "==2.3.1"

[packages]
psycopg2-binary          = "==2.8.2"
boto3                    = "==1.9.166"
pymongo                  = "==3.8.0"
deprecated               = "==1.2.5"
paramiko                 = "==2.6.0"
pandas                   = "==0.24.2"
pyarrow                  = "==0.14.0"
SQLAlchemy               = "==1.3.15"
s3fs                     = "==0.4.0"

[requires]
python_version = "3.7"

HomebrewでPipenvをインストールしました。何が変更されて機能しなくなったかはわかりません。他の古いプロジェクトは引き続き機能しますが、環境を作成しようとするたびに、このエラーが発生します。

ありがとう!

5
pablosjv

だから私はそれをうまく動かすことができました。私のデフォルトpythonシステムのインストールは3.7.3。しかし、pipenvは何らかの理由でそれを気に入らなかった。インストールしましたpython 3.7.7 homebrewとpipenvを使用すると、そのバージョンを適切に特定し、それを使用して仮想環境を作成できました。

要約すると、この問題を修正するには、もう一度python=をインストールしてみてください。私の場合:

brew install python
9
pablosjv