You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
venv does not activate on my manjaro system for zsh #22899
Matthias Mairleitner (@matt-hires) Based on your last comment #22881 (comment), do you mean to say that venv activation works for WSL + windows but not for your current system? If so, can you please provide screenshots on how you're determining whether the environment has activated?
Thanks a lot for this, at this point we need some help from VS Code to reliably predict whether shell integration is working or not: microsoft/vscode#205058. It seems that even though the environment is set for your case:
2024-02-13 06:09:04.848 [debug] Prepending environment variable PATH in collection with /home/matthias/.vscode/extensions/ms-python.python-2024.1.10431006/pythonFiles/deactivate/zsh:/home/matthias/Development/src/cliargsparser/venv/bin:
2024-02-13 06:09:04.848 [debug] Setting environment variable VIRTUAL_ENV in collection to /home/matthias/Development/src/cliargsparser/venv
2024-02-13 06:09:04.849 [debug] Prepending environment variable PS1 in collection with (venv)
2024-02-13 06:09:04.849 [debug] Setting environment variable VIRTUAL_ENV_PROMPT in collection to (venv)
It's not reflected in the terminal. If you click "Show environment contributions" in the previous screenshot, it seems like the PATH variable there isn't being set correctly.
Can you provide a screenshot of all variables that're supposed to be set in "Show environment contributions", and then check which those are set in terminal? For eg. You can run "echo $PATH" to see whether it's set.
Luis Norambuena (@norambna) Can you run "echo $PATH" in your .zshrc shell and report the value you see there?
I'm using the Python extension v2024.1.10441814 (pre-release) now and echo $PATH in my zsh terminal inside VSCode, where my venv is not being activated:
PATH in a zsh terminal when using Python Extension v2024.1.10451007 (pre-release): /home/luis/.pyenv/plugins/pyenv-virtualenv/shims:/home/luis/.pyenv/shims:/home/luis/.pyenv/bin:/home/luis/.vscode/extensions/ms-python.python-2024.1.10451007/pythonFiles/deactivate/zsh:/home/luis/Documents/genp/dj-genp/.venv/bin:/home/luis/.pyenv/bin:/home/luis/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
And PATH when using Python extension v2024.0.1: /home/luis/.pyenv/plugins/pyenv-virtualenv/shims:/home/luis/.pyenv/shims:/home/luis/.pyenv/bin:/home/luis/.pyenv/bin:/home/luis/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Ok great, thanks for confirming. It seems automatic shell integration for zsh shell isn't working for you, same as microsoft/vscode#205133. I encourage you to upvote that to raise awareness and priority.
Activity
karrtikr commentedon Feb 12, 2024
Matthias Mairleitner (@matt-hires) Based on your last comment #22881 (comment), do you mean to say that venv activation works for WSL + windows but not for your current system? If so, can you please provide screenshots on how you're determining whether the environment has activated?
matt-hires commentedon Feb 12, 2024
That's correct. It's working on my Windows machine with wsl, but not on my manjaro linux system.
I checked if the venv was sourced with:
Which should show me the path to the pip in the venv directory, right?
karrtikr commentedon Feb 12, 2024
Actually that's not always true. Try using
which python.matt-hires commentedon Feb 12, 2024
here is a gif how i checked it:
karrtikr commentedon Feb 13, 2024
Thanks, can you also provide the following #22900 (comment)? And lastly, the debug logs again please, make sure to use latest pre-release, thank you.
matt-hires commentedon Feb 13, 2024
✅ Run 'Python: Clear cache and reload window' command
A screenshot when you hover over zsh:

Whether shell integration is actually working:

And lastly, the debug logs again please:
Python.log
karrtikr commentedon Feb 13, 2024
Thanks a lot for this, at this point we need some help from VS Code to reliably predict whether shell integration is working or not: microsoft/vscode#205058. It seems that even though the environment is set for your case:
It's not reflected in the terminal. If you click "Show environment contributions" in the previous screenshot, it seems like the
PATHvariable there isn't being set correctly.karrtikr commentedon Feb 13, 2024
I'm working on a temporary fix to remedy this: #22905, but it seems a long term solution has to come from VS Code at this point .
matt-hires commentedon Feb 13, 2024
I guessed it might be something like this, due to the fact that the shell prompt correctly shows the venv python version.
And also thank you for your investigation into this.
karrtikr commentedon Feb 13, 2024
Of course. If you don't mind could you test out https://github.com/microsoft/vscode-python/actions/runs/7882029722/artifacts/1240529254 and see if it helps? You can use
Extension: Install from VSIXto install the extension.karrtikr commentedon Feb 13, 2024
Actually, that wouldn't help in your case. Never mind.
karrtikr commentedon Feb 13, 2024
Can you provide a screenshot of all variables that're supposed to be set in "Show environment contributions", and then check which those are set in terminal? For eg. You can run "echo $PATH" to see whether it's set.
10 remaining items
[-]venv does not activate on my manjaro system[/-][+]venv does not activate on my manjaro system for zsh[/+]matt-hires commentedon Feb 13, 2024
My contributed environment
My
$PATHenv variableAnd my
$PATHvariable after I sources venv manually by:source venv/bin/activatekarrtikr commentedon Feb 13, 2024
Can you also report the same when trying out the latest release version of the extension?
Appreciate all the help! Matthias Mairleitner (@matt-hires)
karrtikr commentedon Feb 13, 2024
Btw, can you share your
.zshrcif possible?norambna commentedon Feb 13, 2024
I'm using the Python extension v2024.1.10441814 (pre-release) now and
echo $PATHin my zsh terminal inside VSCode, where my venv is not being activated:/home/luis/.pyenv/plugins/pyenv-virtualenv/shims:/home/luis/.pyenv/shims:/home/luis/.pyenv/bin:/home/luis/.vscode/extensions/ms-python.python-2024.1.10441814/pythonFiles/deactivate/zsh:/home/luis/Documents/genp/dj-genp/.venv/bin:/home/luis/.pyenv/bin:/home/luis/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perlAnd the PATH I'm getting in a bash terminal, where my venv is being activated automatically is:
/home/luis/.vscode/extensions/ms-python.python-2024.1.10441814/pythonFiles/deactivate/zsh:/home/luis/Documents/genp/dj-genp/.venv/bin:/home/luis/.pyenv/plugins/pyenv-virtualenv/shims:/home/luis/.pyenv/shims:/home/luis/.vscode/extensions/ms-python.python-2024.1.10441814/pythonFiles/deactivate/zsh:/home/luis/Documents/genp/dj-genp/.venv/bin:/home/luis/.pyenv/bin:/home/luis/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perlmatt-hires commentedon Feb 13, 2024
here you go:
zshrc.zip
this includes
.zshrcas well as an encapsulated.oh-my.zshrcwhich is sourced in the former one.karrtikr commentedon Feb 14, 2024
Thanks. Can any of you provide the value of
PATHasked here #22899 (comment) for the release version of the extension?Btw, both your issues seem to be microsoft/vscode#205133. The above information would help confirm it.
matt-hires commentedon Feb 14, 2024
When using Release Version
v2024.0.1of the extension:Contributed Env:
Path Variable:
And the Path after sourcing venv manually
source venv/bin/activate:norambna commentedon Feb 14, 2024
PATH in a zsh terminal when using Python Extension v2024.1.10451007 (pre-release):
/home/luis/.pyenv/plugins/pyenv-virtualenv/shims:/home/luis/.pyenv/shims:/home/luis/.pyenv/bin:/home/luis/.vscode/extensions/ms-python.python-2024.1.10451007/pythonFiles/deactivate/zsh:/home/luis/Documents/genp/dj-genp/.venv/bin:/home/luis/.pyenv/bin:/home/luis/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perlAnd PATH when using Python extension v2024.0.1:
/home/luis/.pyenv/plugins/pyenv-virtualenv/shims:/home/luis/.pyenv/shims:/home/luis/.pyenv/bin:/home/luis/.pyenv/bin:/home/luis/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perlkarrtikr commentedon Feb 14, 2024
Ok great, thanks for confirming. It seems automatic shell integration for zsh shell isn't working for you, same as microsoft/vscode#205133. I encourage you to upvote that to raise awareness and priority.
As a workaround, try manual installation, which I expect should fix your issues: https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation.
norambna commentedon Feb 14, 2024
Yes, the "Manual installation" solved it on my system! Thanks and I also upvoted microsoft/vscode#205133
matt-hires commentedon Feb 15, 2024
Workaround was also working for me, thx for your effort Kartik Raj (@karrtikr).