工作区包含 Pipfile 但未找到 pipenv [英] Workspace contains Pipfile but pipenv was not found
问题描述
我在 Mac 上使用 VScode 和 pyenv.但是每次我打开一个工作区时,我都会收到这样的消息:
I am using VScode and pyenv on Mac. But each time I opened a workspace, I got this message:
工作区包含 Pipfile 但未找到 pipenv.确保pipenv在 PATH 上.
Workspace contains Pipfile but pipenv was not found. Make sure pipenv is on the PATH.
我的 pipenv 已安装,可以在 VScode 上使用终端找到.
My pipenv is installed and can be found using terminal on VScode.
>which pipenv
/Users/name/.pyenv/shims/pipenv
所以我将python.pipenvPath
设置更改为/Users/name/.pyenv/shims
.这次我得到了:
So I changed thepython.pipenvPath
setting to /Users/name/.pyenv/shims
. This time I got:
工作区包含 Pipfile 但 '/Users/user/.pyenv/shims' 不是成立.确保/Users/user/.pyenv/shims"在 PATH 中.
Workspace contains Pipfile but '/Users/user/.pyenv/shims' was not found. Make sure '/Users/user/.pyenv/shims' is on the PATH.
推荐答案
这是因为当前工作区找不到您的 pipenv 路径.所以在 .vscode 下创建一个 settings.json 并指向正确的 pipenv 路径.
This is because current workspace cannot find your pipenv path. So create a settings.json under .vscode and point to the correct pipenv path.
要查找 pipenv 路径,请转到包含 pipenv 文件的文件夹,
To find pipenv path, go to your folder with pipenv file,
pipenv --py/Users/[用户名]/.local/share/virtualenvs/[app-NVz65APH]/bin/python
pipenv --py /Users/[username]/.local/share/virtualenvs/[app-NVz65APH]/bin/python
然后修改settings.json:
and then modify settings.json:
"python.pythonPath":"/Users/[用户名]/.local/share/virtualenvs/[app-NVz65APH]/bin/python",
"python.pythonPath": "/Users/[username]/.local/share/virtualenvs/[app-NVz65APH]/bin/python",
这篇关于工作区包含 Pipfile 但未找到 pipenv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!