Hi, I have a strange issue with activation of expo...
# general
b
Hi, I have a strange issue with activation of exported virtualenv on mac (same works on WSL) I download https://github.com/pantsbuild/example-python run
pants export --resolve=python-default
and run
Select python interpreter
in VSCode, where I select
dist/export/python/virtualenvs/python-default/3.9.19/bin/python
At this point I expect that vscode activates venv, but it behaves like I selected
/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/bin/python3.9
without virtual env and does not see packages in exported venv
It seems to be something mac related, because the same works fine on WSL
It might be a blocker for my team, because half of them use mac 😞
c
does the exported venv work in the terminal, using
source dist/export/python/virtualenvs/python-default/3.9.19/bin/activate
?
b
yes it does
the only thing that does not work - is some vscode magic which deduces venv from interpreter path
c
huh, strange. I'm no vscode user myself, so don't have any experience to share here unfortunately.
b
I will try to get to the bottom of it :)
👍 1
So far I found that it’s the same behaviour if I create venv with
python3.9 -m venv
, but works fine for
virtualenv
but if the same venv is created in project folder, the same way - it works 😞
so selecting interpreter in file dialog gives you system interpreter, but if you type path by hand it works
funny, that I never met this behaviour before, because other tools put virtualenvs into places where vscode can auto-discover them
c
Good find, and thanks for posting it so others may learn from it :)
👍 1