I made a program in Python3 which uses the package netifaces, I installed it with pip3 in two computers which had Ubuntu 13.04 and Ubuntu 13.10. However, I need to install it in other computer which has Ubuntu 12.04, and here I cannot install pip3 (python3-pip) because it is not on the repositories.

What I did was the next steps:

sudo aptitude install python3-setuptools
sudo easy_install3 pip

And then I had pip3 available. The problem is when I tried to install netifaces with pip3, which gives me next error:

error: command 'gcc' failed with exit status 1
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gkaftl-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/netifaces
Storing debug log for failure in /home/anubia/.pip/pip.log

If I install netifaces with pip or aptitude or apt-get the program does not recognise the library, because its documents are installed in python2 folders. I even tried to do a symbolic link from python3 folders to them, but it did not work.

Any ideas, please?

  • Ok, I found the solution. I did not have enough karma to post it now, but in 8 hours I will be able to do it, so tomorrow I will post it, to help someone who could be in the same situation as me. – forvas Jul 17 '14 at 11:14

I had to install the package python3-dev too, then the installation of netifaces from pip3 did not give me an error and now I can use it.

So the whole process (in my case) was:

sudo aptitude install python3-setuptools
sudo easy_install3 pip
sudo aptitude install python3-dev

sudo pip3 install netifaces

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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