我正在使用虚拟环境包来运行Python,并尝试导入UUID。以下是我收到的跟踪信息:
python -v
>>> import uuid
# /home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/site-packages/uuid.pyc matches /home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/site-packages/uuid.py
import uuid # precompiled from /home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/site-packages/uuid.pyc
import ctypes # directory /usr/lib/python2.7/ctypes
# /usr/lib/python2.7/ctypes/__init__.pyc matches /usr/lib/python2.7/ctypes/__init__.py
import ctypes # precompiled from /usr/lib/python2.7/ctypes/__init__.pyc
dlopen("/home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/lib-dynload/_ctypes.dll", 2);
import _ctypes # dynamically loaded from /home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/lib-dynload/_ctypes.dll
# /usr/lib/python2.7/struct.pyc matches /usr/lib/python2.7/struct.py
import struct # precompiled from /usr/lib/python2.7/struct.pyc
dlopen("/home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/lib-dynload/_struct.dll", 2);
import _struct # dynamically loaded from /home/tanzaho/.virtualenvs/django_wordiz/lib/python2.7/lib-dynload/_struct.dll
# /usr/lib/python2.7/ctypes/_endian.pyc matches /usr/lib/python2.7/ctypes/_endian.py
import ctypes._endian # precompiled from /usr/lib/python2.7/ctypes/_endian.pyc
# /usr/lib/python2.7/ctypes/util.pyc matches /usr/lib/python2.7/ctypes/util.py
import ctypes.util # precompiled from /usr/lib/python2.7/ctypes/util.pyc
之后,Python就会没有任何警告而停止。我尝试从Cygwin重新安装库,但这并没有帮助。
有什么方法可以解决这个问题?
我应该指出,我正在使用Windows7 64位下的Python 2.7。
编辑: 下面的链接帮助我找到了可能的错误来源:Bug python 18784。但我看了一下指定修补程序中的代码,似乎Python甚至没有达到那个点。
解决方案: 由于我的声望太低,我无法“输入解决方案”,所以我在这里发布它作为编辑。 我通过以下补丁找到了解决方案: http://bugs.python.org/file20685/issue11063.patch
python
和python3
软件包中。 - Yaakovuuid.py
之后执行操作。 - Yaakov