我正在使用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'
我刚刚通过安装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中,因此它没有被覆盖。