Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues when installing on Raspberry Pi #3

Open
savnik opened this issue Jun 24, 2016 · 6 comments
Open

Issues when installing on Raspberry Pi #3

savnik opened this issue Jun 24, 2016 · 6 comments

Comments

@savnik
Copy link

savnik commented Jun 24, 2016

running install
running bdist_egg
running egg_info
writing netifaces.egg-info/PKG-INFO
writing top-level names to netifaces.egg-info/top_level.txt
writing dependency_links to netifaces.egg-info/dependency_links.txt
reading manifest file 'netifaces.egg-info/SOURCES.txt'
writing manifest file 'netifaces.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_ext
checking for getifaddrs... found. (cached)
checking for getnameinfo... found. (cached)
checking for optional header files... netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h. (cached)
checking whether struct sockaddr has a length field... no. (cached)
checking which sockaddr_xxx structs are defined... at ax25 in in6 ipx un ash ec ll atmpvc atmsvc dn irda llc. (cached)
building 'netifaces' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DNETIFACES_VERSION=0.8 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -I/usr/include/python2.7 -c netifaces.c -o build/temp.linux-armv7l-2.7/netifaces.o
netifaces.c:1:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

@savnik
Copy link
Author

savnik commented Jun 24, 2016

sudo apt-get install python-dev fixed it.

@Frostlock
Copy link

Same fix worked for me as well.

@maurice-schleussinger
Copy link

maurice-schleussinger commented Feb 4, 2017

@savnik's solution works for both python 2.7 and python 3.

@mtcleverest
Copy link

It shows python-dev has no installation candidate. What to do next?

@maurice-schleussinger
Copy link

@mtcleverest

Have you searched for your problem?

Your apt-get might be missing the repository which contains python-dev.

@JL1946
Copy link

JL1946 commented Nov 19, 2017

I am getting the following error while using iPython (Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08)) in a terminal window on a mac running Sierra and implementing the following example:

For convenience, we also allow you to index the dictionary with the special value 'default', which returns a dictionary mapping address families to the default gateway in each case. Thus you can get the default IPv4 gateway with

gws = netifaces.gateways()
gws['default'][netifaces.AF_INET]
('10.0.1.1', 'en0')


The results from this test - I tried replacing "[]" with "()" in different combinations but get errors as follows:

In [15]: gws=netifaces.gateways
In [16]: gws['default'][netifaces.AF_INET]

TypeError Traceback (most recent call last)
in ()
----> 1 gws['default'][netifaces.AF_INET]

TypeError: 'builtin_function_or_method' object is not subscriptable

In [17]: gws['default'][netifaces.AF_INET]

TypeError Traceback (most recent call last)
in ()
----> 1 gws['default'][netifaces.AF_INET]

TypeError: 'builtin_function_or_method' object is not subscriptable

In [18]: gws('default')[netifaces.AF_INET]

TypeError Traceback (most recent call last)
in ()
----> 1 gws('default')[netifaces.AF_INET]

TypeError: gateways() takes no arguments (1 given)

In [19]: gws'default'

TypeError Traceback (most recent call last)
in ()
----> 1 gws'default'

TypeError: 'builtin_function_or_method' object is not subscriptable

In [20]: gws('default')(netifaces.AF_INET)

TypeError Traceback (most recent call last)
in ()
----> 1 gws('default')(netifaces.AF_INET)

TypeError: gateways() takes no arguments (1 given)

Is there a solution to this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants