Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
netifaces软件包没有';我不能在Linux上的Python3.4下工作_Python_Python 3.x - Fatal编程技术网

netifaces软件包没有';我不能在Linux上的Python3.4下工作

netifaces软件包没有';我不能在Linux上的Python3.4下工作,python,python-3.x,Python,Python 3.x,我在Mac OS上开发了我的应用程序,它运行良好。在Mac电脑上,我可以看到: $ python3 Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> imp

我在Mac OS上开发了我的应用程序,它运行良好。在Mac电脑上,我可以看到:

$ python3
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.version
'0.10.4'
>>> netifaces.interfaces()
['lo0', 'gif0', 'stf0', 'en0', 'en1', 'en2', 'bridge0', 'p2p0', 'awdl0', 'utun1', 'utun0']
~$ python3
Python 3.4.3 (default, Jun 17 2015, 22:58:00) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.version
'0.10.4'    
>>> netifaces.interfaces()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 0] Error
>>> 
这很好。当我将应用程序移动到Linux时,它不起作用——我得到以下结果:

$ python3
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.version
'0.10.4'
>>> netifaces.interfaces()
['lo0', 'gif0', 'stf0', 'en0', 'en1', 'en2', 'bridge0', 'p2p0', 'awdl0', 'utun1', 'utun0']
~$ python3
Python 3.4.3 (default, Jun 17 2015, 22:58:00) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.version
'0.10.4'    
>>> netifaces.interfaces()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 0] Error
>>> 

请包括您的Linux信息:发行版、版本

这个问题很可能是因为您已经从源代码构建了Python3.4,而Python需要特定于发行版的补丁才能在特定版本的Linux上正常工作。这些补丁可能会从python.org上发布的源代码中省略。请咨询您的分发问题跟踪者

对于Ubuntu,在安装Python时使用死蛇存储库:


使用ubuntu 14.04,使用“0.10.4”,对我来说效果很好,我还从sourceWhat version of linux?@PadraicCunningham ubuntu 12.04LTS构建了3.2.16内核。