Answer the question
In order to leave comments, you need to log in
How to create a Python 3.7 virtual environment when there are several versions of the interpreter in a Linux family OS?
I have python2.7, python3.5, python 3.7 installed.
pip uses python version 3.5
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
Answer the question
In order to leave comments, you need to log in
Use pyenv if you are working with different versions of Python. Well, for development it is better to use non-system Python.
So pyenv-installer and go!
you put pyenv you
write in ~/.bash_profile
you put the required version of python: pyenv install 3.7.3
(or whatever you need from the list pyenv install --list
)
you create a virtuality: you pyenv virtualenv 3.7.3 venv37
go to the project directory and set this virtuality by default for the directory:
Voila! When changing to the project directory, the virtualenv is activated automatically.
Each project has its own virtualenv and its own version of python (if necessary, of course) pyenv local venv37
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question