pyenv activate <venv> does not work properly
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:~$
- Ngôn ngữ chính
- Shell
- Star
- 6.7k
- Fork
- 433
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyenv/pyenv-virtualenv
-
Document the virtualenv, activate and deactivate hooksCó thể đã có người làm @officialasishkumar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pyenv/pyenv-virtualenv#552 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Creating a virtualenv from system leaves a self-referencing symlink inside itCó thể đã có người làm @dhananjay6561 đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pyenv/pyenv-virtualenv#548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
virtualenv-delete with a trailing slash can remove all of $PYENV_ROOT/versionsCó thể đã có người làm @dhananjay6561 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
pyenv/pyenv-virtualenv#546 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fish: activating a conda env doesn't set CONDA_PREFIX or run its activate.d/deactivate.d scriptsCó thể đã có người làm @officialasishkumar đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
pyenv/pyenv-virtualenv#550 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`pyenv virtualenv (version) (name)` ignores specified version and uses homebrew's `python` versionĐang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 55/100
pyenv/pyenv-virtualenv#531 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pyenv/pyenv-virtualenv
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Abdk4Moura/tunlion#1014 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
icon request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
PapirusDevelopmentTeam/papirus-icon-theme#4401 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
package-update
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày