pyenv activate <venv> does not work properly
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reproducing the reported pyenv activate test380, python -V, pyenv which python, and exec "$SHELL" sequence in a fresh shell. Inspect how shell initialization and activation affect command selection; done means the activated environment consistently reports Python 3.8.0 without requiring a shell reset.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have just noticed recently, that the above mentioned command does not switch to a virtual environment as before.
Here how it looks like atm:
(base) art@HP:~$ python --version
Python 3.7.4
(base) art@HP:~$ python -V
Python 3.7.4
(base) art@HP:~$ pyenv versions
* system (set by /home/art/.python-version)
3.7.5
3.8.0
3.8.0/envs/cuda380
cuda380
(base) art@HP:~$ pyenv virtualenv 3.8.0 test380
Looking in links: /tmp/tmp49kcmsng
Requirement already satisfied: setuptools in /home/art/.pyenv/versions/3.8.0/envs/test380/lib/python3.8/site-packages (41.2.0)
Requirement already satisfied: pip in /home/art/.pyenv/versions/3.8.0/envs/test380/lib/python3.8/site-packages (19.2.3)
(base) art@HP:~$ pyenv activate test380
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(test380) (base) art@HP:~$ python --version
Python 3.7.4
(test380) (base) art@HP:~$ python -V
Python 3.7.4
(test380) (base) art@HP:~$
From the code above you can see that I created virtual environment called "test380" which is based on 3.8.0 version of python. But when I activate it and check the version it says 3.7.4 - i.e. global version. Same if I will try pip list for example - it will show me the packages of the global python, not the virtual active one. Interesting thing is that if I go to pycharm and add the test380 venv as an interpreter, it will be 3.8.0. I am a bit confused, whats wrong in here, any idea?
I have tried deleting the .pyenv folder and installing it again with
$ curl https://pyenv.run | bash
Now I get some additional messages when I try to display the python version, but the version it shows me is still the global one:
(base) art@HP:~$ pyenv versions
* system (set by /home/art/.python-version)
3.8.0
3.8.0/envs/test380
test380
(base) art@HP:~$ pyenv activate test380
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(test380) (base) art@HP:~$ python -V
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python 3.7.4
After shell reset with '$ exec "$SHELL"" it finally shows the correct venv version, but it works only once, if I reopen the terminal, the problem with wrong version remains until I execute shell reset again. Moreover after shell reset it is not shown which venv is active in the brackets, it only shows (base).
(base) art@HP:~$ pyenv activate test380
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(test380) (base) art@HP:~$ python -V
Python 3.7.4
(test380) (base) art@HP:~$ exec "$SHELL"
(base) art@HP:~$ python -V
Python 3.8.0
(base) art@HP:~$ pyenv which python
/home/art/.pyenv/versions/test380/bin/python
(base) art@HP:~$
- Lingua principale
- Shell
- Stelle
- 6.7k
- Fork
- 433
- Merge medio
- 1g 8h
- PR unite (30g)
- 11
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pyenv/pyenv-virtualenv
-
Document the virtualenv, activate and deactivate hooksForse già presa @officialasishkumar l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
pyenv/pyenv-virtualenv#552 ·
I maintainer di solito rispondono entro 1 giorno
-
Creating a virtualenv from system leaves a self-referencing symlink inside itForse già presa @dhananjay6561 l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pyenv/pyenv-virtualenv#548 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
virtualenv-delete with a trailing slash can remove all of $PYENV_ROOT/versionsForse già presa @dhananjay6561 l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
pyenv/pyenv-virtualenv#546 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Fish: activating a conda env doesn't set CONDA_PREFIX or run its activate.d/deactivate.d scriptsForse già presa @officialasishkumar l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
pyenv/pyenv-virtualenv#550 ·
I maintainer di solito rispondono entro 1 giorno
-
`pyenv virtualenv (version) (name)` ignores specified version and uses homebrew's `python` versionAperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
pyenv/pyenv-virtualenv#531 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pyenv/pyenv-virtualenv
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Abdk4Moura/tunlion#1014 ·
I maintainer di solito rispondono entro 1 giorno
-
icon request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
PapirusDevelopmentTeam/papirus-icon-theme#4401 ·
I maintainer di solito rispondono entro 3 giorni
-
package-update
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno