Skip to content Skip to sidebar Skip to footer

Virtualenv Oserror - Setuptools Pip Wheel Failed With Error Code 1

I get the following error message when trying to set up a virtual environment with virtualenv 15.0.2 but receive OSError setuptools pip wheel failed with error code 1. New python

Solution 1:

I tried for hours, read lots of posts and finally find a way out.

pip uninstall virtualenv conda install virtualenv

The reason is the virtualenv installed by pip is not compatible with conda. I don't know more details, but it works for me.

Solution 2:

I got this error while having several python versions installed on my mac. Specifying which python version to be used for your new virtual environment solves the issue.

By specifying the absolute python path:

virtualenv -p /usr/bin/python2.7 venv

or use your default python link:

virtualenv -p python3 venv

Solution 3:

I had this same issue while installing requirements from requirements.txt.

This was what solved the problem for me.

  1. pip install --upgrade virtualenv

  2. pip install --upgrade pip

  3. After doing this, if you ever get errors while trying to install a dependency like below

THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them. pbr==3.1.1 from https://pypi.python.org/packages/0c/5d/b077dbf309993d52c1d71e6bf6fe443a8029ea215135ebbe0b1b10e7aefc/pbr-3.1.1-py2.py3-none-any.whl#md5=75a0f55856bfc9220af0d01244afec43 (from -r requirements-test.txt (line 52)):

Expected sha256 60c25b7dfd054ef9bb0ae327af949dd4676aa09ac3a9471cdc871d8a9213f9ac Expected or 05f61c71aaefc02d8e37c0a3eeb9815ff526ea28b3b76324769e6158d7f95be1

Got b11776d9eb0e7b3988bb7bdef4e2d40cf8c168214374d12d1c4495c1346ac10b

ERROR: could not install deps [-rrequirements-test.txt]; v = InvocationError('/app/.tox/py27/bin/pip install -rrequirements-test.txt (see /app/.tox/py27/log/py27-1.log)', 1)

________________________________ summary _______________________________

ERROR: py27: could not install deps [-rrequirements-test.txt]; v = InvocationError('/app/.tox/py27/bin/pip install -rrequirements-test.txt (see /app/.tox/py27/log/py27-1.log)', 1)

Then use pip --no-cache-dir install <package-name> to install the package; where <package-name> is the name of the package you want to install.

e.g pip --no-cache-dir install pbr

Solution 4:

I finally resorted to using conda to set up an environment rather than virtualenv. Apparently virtualenv is not compatible with anaconda.

Info in this link helped me set it up:

https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/

Solution 5:

Simply you can do this:

Python 2: virtualenv env

Python 3 : python3 -m venv env

Post a Comment for "Virtualenv Oserror - Setuptools Pip Wheel Failed With Error Code 1"