How to install the library netifaces for Python3 in Ubuntu 12.04?

0

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?

forvas

Posted 2014-07-17T08:42:30.780

Reputation: 773

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 – 2014-07-17T11:14:36.797

Answers

0

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

forvas

Posted 2014-07-17T08:42:30.780

Reputation: 773