小编htc*_*_m8的帖子

Python3:ImportError:使用模块多处理中的值时,没有名为"_ctypes"的模块

我正在使用Ubuntu并安装了Python 2.7.5和3.4.0.在Python 2.7.5中,我能够成功分配变量x = Value('i', 2),但不能在3.4.0中分配.我正进入(状态:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python3.4/multiprocessing/context.py", line 132, in Value
      from .sharedctypes import Value
   File "/usr/local/lib/python3.4/multiprocessing/sharedctypes.py", line 10, in <
module>
   import ctypes
   File "/usr/local/lib/python3.4/ctypes/__init__.py", line 7, in <module>
      from _ctypes import Union, Structure, Array
ImportError: No module named '_ctypes'
Run Code Online (Sandbox Code Playgroud)

我刚刚通过安装3.4.0的源代码更新到3.3.2.它安装在/usr/local/lib/python3.4中.

我是否正确更新到Python 3.4?

有一点我注意到Python 3.4安装在usr/local/lib中,而Python 3.3.2仍然安装在usr/lib中,所以它没有被覆盖.

python install compiler-errors failed-installation python-3.4

86
推荐指数
11
解决办法
10万
查看次数