I have some project that needs python 3.4 but since I am on Ubuntu 18.04 I have python 3.6 installed. If I try to setup the project on 3.6 I get compatibility issues. Please guide how do I install python 3.4 alongside 3.6. And is there a way to make virtualenv use python 3.4 to setup environments.


1 Answer 1


By compile the binary:

Download the zip package of python3.4 from here

extract it and enter in the folder

  1. execute: ./configure
  2. execute: make -j 4 If you have more core insert the number of core of your cpu
  3. execute: make test -j 4 same as above, OPTIONAL but suggested!
  4. execute: sudo make install

If you find the binary package you can skip the compilation steps.

Install virtualenv:

sudo apt install virtualenv

then create a virtual environment with desired python version:

  1. virtualenv --python=python3.4 --clear --always-copy --setuptools .venv
  2. virtualenv .venv --distribute

note: .venv is the path where virtual environment is installed

Alternative to a virtual environment you can use the python executable directly from path you choose, but I recommend you to use a virtual environment, keep your system more clean.

to activate the virtual environment execute the bash script perform following steps:

  1. source .venv/bin/activate

to exit from the virtualenv

  1. exit will close the terminal and the virtualenv.

You can also configure mostly of IDE to use the python virtual env.

Not the answer you're looking for? Browse other questions tagged or ask your own question.