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
Create a new project (e.g. mkdir -p ~/projects/test-project)
Create its own virtual environment:
$ cd ~/projects/test-project/
$ pyenv install 3.9.0
$ pyenv virtualenv 3.9.0 testproject-venv
$ pyenv local testproject-venv
Create a simple script which requires a missing package: $ printf "from money import Money\nprint(\"Success\")" > main.py
Attempting to execute the script fails as expected:
$ python3 main.py
Traceback (most recent call last):
File "/home/ng/projects/test-project/main.py", line 1, in <module>
from money import Money
ModuleNotFoundError: No module named 'money'
Install the missing package: $ pip install money
Re-attempt to launch the script and see it fail when using python3 but succeeding with python:
$ python main.py
Success
$ python3 main.py
Traceback (most recent call last):
File "/home/ng/projects/test-project/main.py", line 1, in <module>
from money import Money
ModuleNotFoundError: No module named 'money'
Both python and python3 are aliases to the same binary:
$ ls -lh $(pyenv which python)
lrwxrwxrwx 1 ng ng 9 Dec 6 15:04 /home/ng/.pyenv/versions/testproject-venv/bin/python -> python3.9
$ ls -lh $(pyenv which python3)
lrwxrwxrwx 1 ng ng 9 Dec 6 15:04 /home/ng/.pyenv/versions/testproject-venv/bin/python3 -> python3.9
What am I missing? Thanks in advance :)
The text was updated successfully, but these errors were encountered:
Minimal reproduction steps
mkdir -p ~/projects/test-project
)$ printf "from money import Money\nprint(\"Success\")" > main.py
$ pip install money
python3
but succeeding withpython
:Both
python
andpython3
are aliases to the same binary:What am I missing? Thanks in advance :)
The text was updated successfully, but these errors were encountered: