導入時出現以下錯誤,但僅在我的虛擬環境(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