Open inickt opened 5 years ago
just hit this as well, i "fixed" by providing a wheel on aa devpi, but thats not ideal
My first attempt to install this failed because I needed to do "apt install python3-pip" My 2nd attempt to install this failed because I needed to do "pip3 install setuptools" My 3rd attempt to install this failed because I needed to do "apt install python3.7-dev" Then it appeared to install but did not function as follows...
$python3
Python3.7.3 ...
>>> import netifaces
>>> netifaces.interfaces()
Traceback (most recent last call):
File "<stdin>", line 1, in <module>
AttributeError: module 'netifaces' has no attribute 'interfaces'
>>>
I believe this is a python 3.7 problem with netifaces. FYI :-)
I'm seeing the same module 'netifaces' has no attribute 'interfaces'
problem. After some experimentation and way too deep a dive into importlib
, I've modified netifaces.py
to read:
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, os
import importlib
from importlib.machinery import ExtensionFileLoader
__file__ = pkg_resources.resource_filename(__name__, 'netifaces.cpython-38-x86_64-linux-gnu.so')
__loader__ = None; del __bootstrap__, __loader__
loader = ExtensionFileLoader(__name__,__file__)
spec = importlib.util.spec_from_loader(__name__, loader)
m = loader.create_module(spec)
loader.exec_module(m)
__bootstrap__()
This seems to fix the problem, at least on Python 3.8. Apparently load_module()
has been deprecated since Python 3.4, so maybe it's not working any more, or is used incorrectly here?
Edit: That file is not in the repo here, so I guess it's generated. Needs more investigation.
I just came across this issue. I've noticed that this repo has a build-manylinux
script that generates the wheels, ran it locally and found that it does generate wheels for python 3.7, 3.8 and 3.9.
Is there any reason why they're not available on PyPI?
Wheels generated by the script:
netifaces-0.10.9-cp27-cp27m-manylinux1_i686.whl netifaces-0.10.9-cp35-cp35m-manylinux1_i686.whl netifaces-0.10.9-cp37-cp37m-manylinux1_i686.whl netifaces-0.10.9-cp39-cp39-manylinux1_i686.whl
netifaces-0.10.9-cp27-cp27m-manylinux1_x86_64.whl netifaces-0.10.9-cp35-cp35m-manylinux1_x86_64.whl netifaces-0.10.9-cp37-cp37m-manylinux1_x86_64.whl netifaces-0.10.9-cp39-cp39-manylinux1_x86_64.whl
netifaces-0.10.9-cp27-cp27mu-manylinux1_i686.whl netifaces-0.10.9-cp36-cp36m-manylinux1_i686.whl netifaces-0.10.9-cp38-cp38-manylinux1_i686.whl
netifaces-0.10.9-cp27-cp27mu-manylinux1_x86_64.whl netifaces-0.10.9-cp36-cp36m-manylinux1_x86_64.whl netifaces-0.10.9-cp38-cp38-manylinux1_x86_64.whl
Went to install some dependencies and my
pyenv sync
was failing due to netifaces failing to build from source. Installingpython3-devel
allows me to work with it for now, but it would be nice to have Linux wheels for 3.7. Thanks!