Python UUID import failed on Cygwin 64bits

I am running python inside a shell of a virtual environment and I am trying to import a UUID. Here is what I get:

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, the python just stops without any other warning. I tried reinstalling the library from Cygwin, but that didn't help.

Is there any way to fix this?

I must indicate that I am using python 2.7 under 64-bit versions of Windows7.

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

Solution Because I cannot “enter the solution” because my reputation is too low, I post it as an edit here. I found a solution through the following patch: http://bugs.python.org/file20685/issue11063.patch

+7
python uuid cygwin
source share
3 answers

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

The following discussion discusses the solution at: https://github.com/kennethreitz/requests/issues/1547 .

+6
source share

install libuuid-devel

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

 apt-cyg install libuuid-devel 

after that the installation works

 easy_install requests printf "help('modules')" | python | grep requests array hotshot requests xmlrpclib 
+1
source share

As Jacob notes, the error you encountered was noted as CPython Issue 18784 and was fixed since September 13, 2013 in servicing branches for Python 2.7, 3.3 and development branch (3.4).

If you need to fix an existing Python system, you can do the following: a patch from Eugene Sologubov that closes the uuid module from trying to load additional libraries after the uuid routines have been installed:

 diff -r 4a318a45c4c3 Lib/uuid.py --- a/Lib/uuid.py Mon Aug 19 13:07:18 2013 -0400 +++ b/Lib/uuid.py Mon Aug 19 21:41:08 2013 +0400 @@ -429,6 +429,8 @@ _uuid_generate_random = lib.uuid_generate_random if hasattr(lib, 'uuid_generate_time'): _uuid_generate_time = lib.uuid_generate_time + if _uuid_generate_random is not None: + break # found everything we were looking for # The uuid_generate_* functions are broken on MacOS X 10.5, as noted # in issue #8621 the function generates the same sequence of values 

There are even deeper problems with ctypes that need to be fixed, but this should fix the many serious problems that people see when installing Python packages on Cygwin64.

0
source share

All Articles