'How to run a previous version of Python using virtualenv?
My native python installation is currently 3.10.2, however there is a program I need to use that is only compatible with 2.7-3.8. Rather than deleting my native installation and installing an outdated version, I'm trying to run Python 3.8 in virtualenv, but even when I set pyenv global 3.8.13, the python version in my virtualenv is still 3.10.2.
Demonstration:
set global version
pyenv global 3.8.13
verify
pyenv global
returns
3.8.13
make virtual environment
pyenv virtualenv test
pyenv activate test
python --version
returns
Python 3.10.2
Following the instructions on this post How do I install a previous version of Python into a virtualenv?, I have both pyenv and virtualenv installed, as well as python 3.8 in the $HOME/.pyenv/versions folder. Any idea why this version isn't being used in the virtual environments that I create?
output of pyenv versions
system
* 3.8.13 (set by $HOME/.pyenv/version)
Let me know if I can provide more detail.
Solution 1:[1]
Does this help?
pyenv virtualenv 3.8.13 test
Then use either of the following:
cd /path/to/project
pyenv local 3.8.13/envs/test
pyenv activate 3.8.13/envs/test
Source: https://github.com/pyenv/pyenv-virtualenv#using-pyenv-virtualenv-with-pyenv
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
