I have a python virtual environment in /Documents and a project in /Documents/Code/Python/example. I want to use this venv in my project but I can't get the vs code python interpreter to recognize that the venv in /Documents is a venv.
I tried to use set the interpreter path by using the "Find..." button to manually select /Documents/.venv/bin/python with the finder. However, it is recognizing it as something other than a virtual environment as it looks different when compared to a venv in the same directory as the project. Here is the output below:
2024-08-08 16:53:55.325 [info] Discover tests for workspace name: example - uri: /Users/varun/Documents/Code/Python/example
2024-08-08 16:53:55.326 [info] Python interpreter path: /opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12
How it looks when venv is in a parent directory
How it looks when venv is in same directory
I suspect that it is because /Documents/.venv/bin/python is referencing a "faulty" version of python (I'm not sure though). I'm able to activate and use the venv from the terminal to run the code but with vs code not recognizing the venv it isn't giving me any autofill suggestions. Please let me know if you need more info, thanks.