Page MenuHome

Python/Windows issue: "import uuid" results in an error popup
Closed, ResolvedPublic

Description

Reproduce:

- Open Blender on a computer with any Windows Operating system
- Open the python console
- Enter: import uuid

I get a popup window stating:

R6034 An application has made an attempt to load the C runtime library incorrectly...

This popup occurs only on the very first attempt to load it.
Subsequent "import uuid" statements do not raise the error again.

Details

Type
Bug

Event Timeline

Additional info: This error only occurs on Windows systems.
Linux and OSX do not suffer from this problem!

This is very strange, it seems to be an MSVC dependancy issue.

Info I dug up on this issue:
http://bugs.python.org/issue4022
http://weblogs.asp.net/george_v_reilly/archive/2007/02/10/shell-extension-throwing-r6034-errors.aspx

Oddly enough it works in msvc2008 and msvc2010, on my windows XP system but 2.57b release and MinGW builds give the error.

closing. (if for some reason the fix isn't working reply and I'll re-open)

I just updated to revision 37604. Unfortunately i still get the exact same problem when i open the python console and then:

import uuid

I am on windows 7 and i used scons for building:

python scons/scons.py

Make sure you don't have any runtime dlls in BF_INSTALLDIR, these will interfere with the fix.

I am building Blender with Visual c++ 2008 Express edition
and 32 bit python and using the following command:

python scons/scons.py

Here is the list of libraries i have in the installation directory after
the build completes:

BlendThumb.dll
BlendThumb64.dll
OpenAL32.dll
SDL.dll
avcodec-52.dll
avdevice-52.dll
avformat-52.dll
avutil-50.dll
gnu_gettext.dll
iconv.dll
libpng.dll
libsndfile-1.dll
pthreadVC2.dll
python32.dll
swscale-0.dll
wrap_oal.dll
zlib.dll

The fix does still not work for me after completely rebuilding Blender:

- i deleted the entire installation directory
- i called: "python scons/scons.py clean"
- i called: "python scons/scons.py"

After i open Blender, i go to the python console and:

import uuid

still gives me the error as initially reported.

I also tried to build for 64 bit. But i was not able to create a 64-bit Blender
based on my current setup. I also hesiotate to follow the "hack" described
on the Blender wiki, which is not even "officially supported by blebnder developers"

Maybe someone with a working 32-bit version can verify that the issue is not solved
for 32-bit builds.

The uuid.py module in Python uses ctypes to get platform specific uuid creation routines (for performance benefits). So I think this is probably related to previous ctypes problems on Windows.

A workaround is to remove all the ctypes stuff from Python's uuid.py to avoid triggering the problem.

python bug -> http://bugs.python.org/issue17213 (from terrachild in irc)

I think most simple solution is that we apply this work around

Current windows x64 msvc 2013 build does not suffer from this problem.
Can someone reconfirm this ?

It still occurs in windows XP/32bits msvc 2008.

Campbell Barton (campbellbarton) closed this task as Resolved.EditedMay 5 2014, 10:22 PM

Closing, with Python3.4x and MSVC2013 this is now resolved.

It still occurs in windows XP/32bits msvc 2008.
SHA-1: 9f16428cb5f047bf46bc338746a0fa84add6e720

We wont be using MSVC2008 for the official release.

Understood it; then I change the wording.
An error still occurs in blender-2.70-7660218-win32.zip for official release.