我使用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 /地方/ lib中,而Python 3.3.2仍然安装在usr / lib中,所以它没有被覆盖。