admin管理员组文章数量:1391981
So yesterday i noticed that the vscode terminal was using the global pip instead of the pip in my virtual environment when trying to use pip or package commands. Running the python file is no problem. I haven't been able to fix this since.
'pip list' command from vscode terminal
Here is the same command from cmd window:
'pip list' command from command prompt
So yesterday i noticed that the vscode terminal was using the global pip instead of the pip in my virtual environment when trying to use pip or package commands. Running the python file is no problem. I haven't been able to fix this since.
'pip list' command from vscode terminal
Here is the same command from cmd window:
'pip list' command from command prompt
Share Improve this question asked Mar 12 at 16:23 Mathis H.Mathis H. 33 bronze badges2 Answers
Reset to default 0This very likely means that your vscode terminal uses also the wrong Python environment and another Python executive than your project uses.
Set the Python Interpreter in VS Code
1. Open VS Code.
2. Open the Command Palette (Cmd + Shift + p)
(or: Ctrl + Shift + p)
3. Search for Python: Select Interpreter.
4. Select “Enter interpreter path” → “Find…”.
5. Navigate to the Python path of your project
(`which python` might help to clarify that from within
your project's python - if you are in windows,
install scoop and install linux tools using scoop install).
6. Confirm selection.
From your screenshots it appears that you do not have a virtual environment in your Windows DOS shell. Use a Linux command line emulator such as git bash or WSL. Setup `.bash_profile` with the following … source /.venv/bin/activate. To create a venv `python3 -m venv .venv `. In addition, you need to tell Code which interpreter to use. This is found here Selecting python interpreter in VSCode
本文标签: pythonVSCode terminal uses global pip instead of venv pipStack Overflow
版权声明:本文标题:python - VSCode terminal uses global pip instead of venv pip - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744740472a2622577.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论