-
-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to activate virtualenv #401
Comments
This means that you haven't run The current message is misleading as it doesn't tell you this. See #389 for discussion on what to do about that. |
I am. This is the current pyenv section of my .bashrc
|
Figured out the possible cause: #402 |
This is a wrong command. Check the README. |
Hello, a my colleague finds this trick to activate Virtualenvs with Pyenv >= 2.0 . Add the following row in file
I think it is not the best way to do it but for now, it works. |
It's strange, I see everything is fine in my |
For me it's fine. I'm using that in Ubuntu 20.04. For me, the problem was that the virtualenv looked like active, but the python used was the OS one. |
For me it uses |
Don't know exactly what was the problem, but after upgrading (vscode upgraded too) and rebooting (since kernel update) everything is working fine. My export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)" |
I was having the same issue with pyenv==2.0.5 and pyenv-virtualenv==1.1.5. Strangely though python 3 venvs were working fine, but when I tried to create a 2.7 venv it was actually created using 3.9 (the system version):
It looks that the fallback to the system version is happening here: pyenv-virtualenv/bin/pyenv-virtualenv Line 566 in 29fb3c7
And the reason why it was happening seems to be the absense of both Actually, the pyenv-virtualenv/bin/pyenv-virtualenv Lines 145 to 147 in 29fb3c7
So I did |
Please see updated and hopefully clearer Pyenv shell setup instructions in https://github.com/pyenv/pyenv#readme |
I came here to open an issue, but after I tried the above config, everything seems to be working for me too 🎉 My previous config was just:
I was missing:
|
Does this work for people still? Tried these in every possible combination/order but still can't get virtual envs to automatically load anymore. Note manual activation via |
@laur89 yes, this still works for me. |
@pohmelie do you use bash? Had forgotten that |
@laur89 |
$ pyenv sh-activate
pyenv-virtualenv: version `system' is not a virtualenv
false Any idea where it picks $ cat .python-version
#3.9.7
venv39 and as stated above, manually running |
Are you sure comments in sytax are supported? |
Until now it's worked fine. Removing the commented line also doesn't change anything. |
Trying to look bit more into this now. I discovered that new shell instances that are started work just fine, but not the one that was started at system startup. In the non-working shell, it looks like
In working shells this logic path is not taken, as in pyenv-exec does not seem to be called at all during shell startup. Comparing Bad shell:
Good/working shell:
Edit: my problem is specific to my system, it's to do with how I'm launching the problematic shell. See pyenv/pyenv#2733 |
Hi, wondering if there is a way to autoactivate virtualenv using zsh too? |
Best open a new issue. But did you check this? |
I have indeed. This is what is in my export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export PATH=$PYENV_ROOT/shims:${PATH}
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)" |
Further to encountering the same symptoms reported in this pyenv issue, I added "--path" to the "eval pyenv init" invocation in my .bashrc. While pyenv now uses the correct python executable, it no longer works with pyenv-virtualenv and a simple "pyenv activate foobar" reports the titular error.
The text was updated successfully, but these errors were encountered: