我不能从C扩展标准库中导入进口模块。 这件事发生后,我从12.04升级到Ubuntu 14.04。 我试着重新安装蟒蛇,蟒蛇-dev的,但它没有帮助。 我注意到其他人有类似的帖子,但它们都使用的virtualenv,而我没有使用这一切。
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle, email, json, readline, socket, turtle
>>> import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/ctypes/__init__.py", line 10, in <module>
from _ctypes import Union, Structure, Array
ImportError: No module named _ctypes
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: No module named _io
>>> import datetime
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named datetime