I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtualenv with a different version of Python?
I compiled Python 2.6.2 and would like to use it with some virtualenv. Is it enough to overwrite the binary file? Or do I have to change something in respect to the libraries?
Installing Virtualenv using pip3You must first install a custom version of Python 3. This custom installation of Python 3 will also contain pip3. After it's installed and activated, run the which python3 command as shown in the article. This should return the location of your custom version of Python 3.
Creating a Python Virtual Environment virtualenv supports older Python versions and needs to be installed using the pip command. In contrast, venv is only used with Python 3.3 or higher and is included in the Python standard library, requiring no installation.
Just use the --python
(or short -p
) option when creating your virtualenv instance to specify the Python executable you want to use, e.g.:
virtualenv --python=/usr/bin/python2.6 <path/to/new/virtualenv/>
N.B. For Python 3.3 or later, refer to The Aelfinn's answer below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With