python - 无法使用 python 3.7 启动 pipenv

标签 python django pipenv

我遵循 William S. Vincent 在 DjangoForBeginners 中的示例,并尝试在 python 3.7 中为 django==2.7 启动虚拟环境,但似乎启动 pipenv 只需要 Python 3.6。

Jamess-MacBook-Pro:ch04 otomes$ pipenv install django==2.1
Warning: Your Pipfile requires python_version 3.6, but you are using None (/Users/otomes/.local/share/v/o/bin/python).
  $ pipenv --rm and rebuilding the virtual environment may resolve the issue.
  $ pipenv check will surely fail.
Installing django==2.1…
Adding django to Pipfile's [packages]…
✔ Installation Succeeded 
Installing dependencies from Pipfile.lock (e222e2)…
An error occurred while installing django==2.1 --hash=sha256:7f246078d5a546f63c28fc03ce71f4d7a23677ce42109219c24c9ffb28416137 --hash=sha256:ea50d85709708621d956187c6b61d9f9ce155007b496dd914fdb35db8d790aec! Will try again.
An error occurred while installing pytz==2019.1 --hash=sha256:303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda --hash=sha256:d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141! Will try again.
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:00
Installing initially failed dependencies…
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:00
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
[pipenv.exceptions.InstallError]:       editable_packages=state.installstate.editables,
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1992, in do_install
[pipenv.exceptions.InstallError]:       skip_lock=skip_lock,
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 862, in do_install_dependencies
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, False, failed_deps_queue, retry=False)
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: []
[pipenv.exceptions.InstallError]: ['dyld: Library not loaded: @executable_path/../.Python', '  Referenced from: /Users/otomes/.local/share/virtualenvs/otomes-cBliFOGJ/bin/python3.6', '  Reason: image not found']
ERROR: ERROR: Package installation failed...

我只需要知道如何重新安装我的 pipenv。

最佳答案

Pipenv 创建的 virtualenv 坏了;可能是它引用的 Python 版本被卸载或者它的位置被移动了。

告诉 pipenv 删除它:

pipenv --rm

当您再次运行 pipenv install 时,将为您创建一个新的 virtualenv。

关于python - 无法使用 python 3.7 启动 pipenv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55831903/

相关文章:

java - 有没有类似于 Django auth 应用程序的 Java 用户管理包?

python - Pipenv:找不到命令

python - 了解统计模型线性回归

python - 字符串替换并保存到新文件 (Python v2.7)

django - MacVim 中的错误命令输出

python - 我的项目和 pipenv 使用的 python 解释器的耦合

Python 3 - 你如何告诉 pipenv 使用 python 3 而不是 python 2?

python - paraview python脚本: Delete(renderView1) does not free memory

Python if/elif 条件

python - 如何限制 Django 模型中数值字段的最大值?