virtualenv + python-future = broken virtualenv
For Ubuntu 14.04, this combination worked for me:
- Install pip for python 3.4 (https://pip.pypa.io/en/stable/installing/):
$ wget https://bootstrap.pypa.io/get-pip.py -O - | sudo python3.4
- Replace the old virtualenv (python 2.7 to python 3.4) :
$ sudo pip3.4 install virtualenv
- Just to check:
$ head -n 1 /usr/local/bin/virtualenv
#!/usr/bin/python3
- Now, the following commands will run:
$ virtualenv venv34
Using base prefix '/usr'
New python executable in venv34/bin/python3
Also creating executable in venv34/bin/python
Installing setuptools, pip, wheel...done.
$ ./venv34/bin/pip install virtualenv
Collecting virtualenv
Using cached virtualenv-13.1.2-py2.py3-none-any.whl
Installing collected packages: virtualenv
Successfully installed virtualenv-13.1.2
$ ./venv34/bin/virtualenv -p python venv
Running virtualenv with interpreter /usr/bin/python
New python executable in venv/bin/python
Installing setuptools, pip, wheel...done.
$ /usr/bin/python --version
Python 2.7.6
$ ./venv/bin/pip install future virtualenv
Collecting future
Collecting virtualenv
Using cached virtualenv-13.1.2-py2.py3-none-any.whl
Installing collected packages: future, virtualenv
Successfully installed future-0.15.2 virtualenv-13.1.2
$ ./venv34/bin/pip install future
Collecting future
Installing collected packages: future
Successfully installed future-0.15.2
- To avoid compilation errors from Python extensions written in C or C++ (ref):
$ sudo apt-get update
$ sudo apt-get install -y build-essential
$ sudo apt-get install -y python3.4-dev
$ sudo apt-get install -y python3-software-properties
Now, tox runs beautifully :)