I am using a fully updated installation of Manjaro (as of 15/08/2020). Using python 3.8.3 for this project.
I would like to use the python module netifaces to determine the IP address of one of my network interfaces. I have tried installing the module both through pip (sudo pip install netifaces
) and pacman (sudo pacman -S python-netifaces
). Both give me netifaces version 0.10.9. However, when I run
import netifaces
interfaces = netifaces.interfaces()
print(interfaces)
I get the following error message:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-e0d29647271f> in <module>
1 import netifaces
----> 2 interfaces = netifaces.interfaces()
AttributeError: module 'netifaces' has no attribute 'interfaces'
When I then check dir(netifaces)
I get
['__builtins__',
'__cached__',
'__doc__',
'__file__',
'__loader__',
'__name__',
'__package__',
'__spec__']
It however does work fine with python 2.7.18, where it returns a list of my network interfaces as expected.
It also works perfectly on my openSUSE Leap 15.1 installation. This uses python 3.6.10 and netifaces 0.10.9.
I don't seem to be able to find any similar problems let alone their solutions when searching. Any help would be greatly appreciated.