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

21,800

Solved!

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
Share:
21,800
forvas
Author by

forvas

Currently working with Python, XML, Bootstrap, Odoo framework, PostgreSQL and more. I am a developer who likes learning and helping. One of my fun Odoo modules: https://www.odoo.com/apps/modules/10.0/anb_russia_2018_sweepstake/

Updated on January 17, 2020

Comments

  • forvas
    forvas over 4 years

    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?

  • DKebler
    DKebler over 6 years
    In my case at least what was missing was a .h header file that apparently is in the python3-dev library. I am on ubuntu xenial and don't program in python so that dev library was not loaded by default.