"pip install unroll": "python setup.py egg_info" failed with error code 1
Solution 1:
About the error code
According to the Python documentation:
This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value. The names and descriptions are borrowed from linux/include/errno.h, which should be pretty all-inclusive.
Error code 1 is defined in errno.h
and means Operation not permitted
.
About your error
Your setuptools do not appear to be installed. Just follow the Installation Instructions
from the PyPI website.
If it's already installed, try
pip install --upgrade setuptools
If it's already up to date, check that the module ez_setup is not missing. If it is, then
pip install ez_setup
Then try again
pip install unroll
If it's still not working, maybe pip didn't install/upgrade setup_tools properly so you might want to try
easy_install -U setuptools
And again
pip install unroll
Solution 2:
Here's a little guide explaining a little bit how I usually install new packages on Python + Windows. It seems you're using Windows paths, so this answer will stick to that particular SO:
- I never use a system-wide Python installation. I only use virtualenvs, and usually I try to have the latest version of 2.x & 3.x.
- My first attempt is always doing
pip install package_i_want
in some of my Visual Studio command prompts. What Visual Studio command prompt? Well, ideally the Visual Studio which matches the one which was used to build Python. For instance, let's say your Python installation saysPython 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
. The version of Visual Studio used to compile Python can be found here, so v1500 means I'd be using vs2008 x64 command prompt - If the previous step failed for some reason I just try using
easy_install package_i_want
- If the previous step failed for some reason I go to gohlke website and I check whether my package is available over there. If it's so, I'm lucky, I just download it into my virtualenv and then I just go to that location using a command prompt and I do
pip install package_i_want.whl
- If the previous step didn't succeed I'll just try to build the wheel myself and once it's generated I'll try to install it with
pip install package_i_want.whl
Now, if we focus in your specific problem, where you're having a hard time installing the unroll package. It seems the fastest way to install it is doing something like this:
git clone https://github.com/Zulko/unroll
cd unroll && python setup.py bdist_wheel
- Copy the generated unroll-0.1.0-py2-none-any.whl file from the created dist folder into your virtualenv.
pip install unroll-0.1.0-py2-none-any.whl
That way it will install without any problems. To check it really works, just login into the Python installation and try import unroll
, it shouldn't complain.
One last note: This method works almost 99% of the time, and sometimes you'll find some pip packages which are specific to Unix or Mac OS X, in that case, when that happens I'm afraid the best way to get a Windows version is either posting some issues to the main developers or having some fun by yourself porting to Windows (typically a few hours if you're not lucky) :)
Solution 3:
It was resolved after upgrading pip:
python -m pip install --upgrade pip
pip install "package-name"
Solution 4:
I got stuck exactly with the same error with psycopg2
. It looks like I skipped a few steps while installing Python and related packages.
sudo apt-get install python-dev libpq-dev
- Go to your virtual env
pip install psycopg2
(In your case you need to replace psycopg2
with the package you have an issue with.)
It worked seamlessly.
Solution 5:
I got this same error while installing mitmproxy
using pip3
. The below command fixed this:
pip3 install --upgrade setuptools