pyvenv-3.4 error: returned non-zero exit status 1

Unfortunately, 14.04 shipped with a broken pyvenv. According to this launchpad thread the issue will be resolved in the upcoming 14.04-1

Using this method you can install a Pyvenv environment without pip and then manually install pip after the fact.

pyvenv-3.4 --without-pip myvenv
source ./myvenv/bin/activate
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-3.4.4.tar.gz
tar -vzxf setuptools-3.4.4.tar.gz
cd setuptools-3.4.4
python setup.py install
cd ..
wget https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz
tar -vzxf pip-1.5.6.tar.gz
cd pip-1.5.6
python setup.py install
cd ..
deactivate
source ./myvenv/bin/activate

Reason: Both Ubuntu 14.04 and Debian have a broken pyvenv-3.4 tool. See Ubuntu bug 1290847 and Debian bug 732703.

Solution/workaround (shorter than the one from the other answer):

pyvenv-3.4 --without-pip venvdir
source venvdir/bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python
deactivate
source venvdir/bin/activate

I've described this bug in my own Gist. The URL in this code is from the official pip installation instructions.


This should work too:

sudo apt-get install python-virtualenv
virtualenv -p python3 myvenv

Or better yet:

sudo apt-get install python3-pip
sudo pip3 install virtualenv
virtualenv myvenv

Tags:

Python3

14.04