# import socket error in addon

I was trying to install the Blender Cloud addon and got a python error. It looks like it is trying to load the socket library but is failing. If I go to the Blender directory and run the python console from the command line, I can do an import with no error, but I cannot from the Blender python console. It is the same python installation since I have no installation external to Blender. Here is the result of an import socket from the Blender python console:

Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\socket.py", line 49, in <module>
import _socket
ImportError: DLL load failed: %1 n’est pas une application Win32 valide.


So it's an invalid win32 DLL, it says. The entire call when installing the addon (it's mostly the same thing):

Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender\2.78\scripts\modules\addon_utils.py", line 330, in enable
mod = __import__(module_name)
File "C:\Users\nicolas\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender_cloud\__init__.py", line 48, in <module>
wheels.load_wheels()
File "C:\Users\nicolas\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender_cloud\wheels\__init__.py", line 64, in load_wheels
load_wheel('lockfile', 'lockfile')
File "C:\Users\nicolas\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender_cloud\wheels\__init__.py", line 48, in load_wheel
module = __import__(module_name)
File "C:\Users\nicolas\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender_cloud\wheels\lockfile-0.12.2-py2.py3-none-any.whl\lockfile\__init__.py", line 58, in <module>
import socket
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\socket.py", line 49, in <module>
import _socket
ImportError: DLL load failed: %1 n’est pas une application Win32 valide.


I'm running a Windows 10 64bits and Blender 2.78. Any idea?

• are you running a x64 version of Blender for windows? latest 2.79 builds from builder.blender.org import socket no problem. – zeffii Aug 31 '17 at 8:12
• also.. does your Blender Python console say something like PYTHON INTERACTIVE CONSOLE 3.5.3 (default, May 20 2017, 19:10:40) [MSC v.1800 64 bit (AMD64)] ? – zeffii Aug 31 '17 at 8:13
• @zeffii 2.78c x64 version, yes. Funny, in 2.79, it works properly, just like you, but not in 2.78c 2.78c says: PYTHON INTERACTIVE CONSOLE 3.5.2 (default, Dec 1 2016, 20:58:16) [MSC v.1800 64 bit (AMD64)] 2.79 says: PYTHON INTERACTIVE CONSOLE 3.5.3 (default, May 20 2017, 19:10:40) [MSC v.1800 64 bit (AMD64)] – Kiskit Aug 31 '17 at 20:44
• Tried to download a portable 2.78 so that I'm sure it hasn't been altered by any weird operation afterwards. Portable fails the test too. So I'm probably going to use 2.79 until it becomes the official version, at least for my Blender Cloud needs. Thanks for your help. – Kiskit Aug 31 '17 at 21:13
• Sometimes the official release builds don't get everything right. I'm not sure it makes sense to submit a bug report because the add-on is fine, and whatever Python compiling problem was experienced for 2.78c has been resolved in 2.79. Unless you have something super critical consider using 2.79 builds . – zeffii Sep 1 '17 at 8:52

## 1 Answer

Try the following:

• Close Blender
• Rename C:\Users\YourNameHere\AppData\Roaming\Blender
Foundation\Blender\2.79
to
C:\Users\YourNameHere\AppData\Roaming\Blender
Foundation\Blender\2.79.bak
• Use your login in Windows instead of YourNameHere and your version of Blender instead of 2.79
• Start Blender again
• I see you posted to of the exact same answer, which is fine, just be sure it really answers the questions. (There are very few cases where the question is not a dup and a simple copy paste will answer it.) – David Apr 11 '18 at 2:45
• My subscription has expired so I won't know if it works or not :) – Kiskit Apr 11 '18 at 11:57
• @David, yes the same solution for the same problem DLL load failed: %1 is not a valid Win32 application – vvoovv Apr 12 '18 at 7:10
• @Kiskit, was it a joke? Blender is free and open source. – vvoovv Apr 12 '18 at 7:11
• Blender Cloud is not – Kiskit Apr 13 '18 at 11:40