导入时出现以下错误,但仅在我的虚拟环境(Python 3.4)中导入。在virtualenv中的在virtualenv中导入Python的ctypes错误
>>> import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.4/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: /home/user/Code/Python/venvs/main/lib/python3.4/lib-dynload/_ctypes.cpython-34m-x86_64-linux-gnu.so: undefined symbol: _PyTraceback_Add
PIP冻结:
beautifulsoup4==4.4.0
blessings==1.6
Django==1.8.4
image==1.4.1
Pillow==2.9.0
wheel==0.24.0
我该如何解决这个问题?它适用于主要的python 3.4解释器...
在3.4.3中,旧的'_ctypes_add_traceback'被移动到内部API,_PyTraceback_Add(参见[issue 22462](http://bugs.python.org/issue22462))。看起来,您在某种程度上使用了带有较旧版本Python 3.4的'_ctypes'扩展模块的3.4.3 +版本。 – eryksun
非常感谢@eryksun!它现在工作:) – David