简体   繁体   中英

VSCode not detecting Python Virtual Environment on Mac OS

VS Code refuses to use the virtual environment on my Mac.
I believe it has to do with the fact that Python doesn't get added directly to the venv but as a shortcut instead.

在此处输入图像描述

How can I make it so VSCode recognizes my virtual environment?

After about 50 times of trying this, it finally worked.

"python.pythonPath": "env/venv/bin/python3.9"

In my case I had to open the project folder on the same workspace. Than, worked. Example: I had: folderProject/app/venv. When I open the folder project and try load venv, it doen´t work. But with I open app as my workspace and venv inside app folder everything work,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM