Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UUID python import fails on Cygwin 64bits

I am running python within a virtual environment wrapper and I try to import UUID. Here is the trace of what I receive :

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

After that, python just stops without any other warning. I tried to reinstall the library from Cygwin, but that did not help.

Is there a way I can fix this?

I should specify that I am using python 2.7 under Windows7 64bits.

Edit The following link helped me to find a possible eerror soure : Bug python 18784 . But I looked at the code specified in the patch and it seems that python does not even reach that point.

Solution As I cannot 'enter the solution' because my reputation is too low, I post it as an edit here. I found the solution via the following patch : http://bugs.python.org/file20685/issue11063.patch

like image 325
Tanzaho Avatar asked Sep 22 '13 18:09

Tanzaho


2 Answers

I had the same symptoms on 64-bit Cygwin. Installing the "libuuid-devel" and "binutils" Cygwin packages resolved the import crash for me.

There's more discussion about solutions at: https://github.com/kennethreitz/requests/issues/1547.

like image 122
Jeff S Avatar answered Oct 16 '22 06:10

Jeff S


install libuuid-devel

the solution is here https://github.com/kennethreitz/requests/issues/1547#issuecomment-29301616

apt-cyg install libuuid-devel

after this the installation works

easy_install requests

printf "help('modules')" | python | grep requests
array               hotshot             requests            xmlrpclib
like image 20
John Peterson Avatar answered Oct 16 '22 07:10

John Peterson