Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / Can't load a standard python lib in Mobu 2009
  RSS 2.0 ATOM  

Can't load a standard python lib in Mobu 2009
Rate this thread
 
22331
 
Permlink of this thread  
avatar
  • Location: Los Angeles
  • Total Posts: 19
  • Joined: 04 October 2007 09:54 PM

Easy to reproduce:

import cookielib

result:

Traceback (most recent call last):
 
File "<string>"line 1in <module>
 
File "C:\Program Files (x86)\Autodesk\MotionBuilder 2009\bin\x64\python25.zip\cookielib.py"line 31in <module>
 
File "C:\Program Files (x86)\Autodesk\MotionBuilder 2009\bin\x64\python25.zip\urllib.py"line 26in <module>
 
File "C:\Program Files (x86)\Autodesk\MotionBuilder 2009\bin\x64\python25.zip\socket.py"line 45in <module>
ImportErrorNo module named _socket

I found _socket in C:\Python25\DLLs\

try:
    
import cookielib
except
:
    
import sys
    sys
.path.append("C:\\Python25\\DLLs\\")
    
import cookielib

Still get the same problem.

Anyone found a way around this?

E.



Replies: 0
avatar

Hi Eric,

Do you have your PYTHONPATH environment variable set to:

C:\Python25\Lib

I am don’t get that error, are you on MoBu 2009?

~Kristine



KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn

Replies: 0
avatar

Kristine,

Thanks for the reply. This problem has already been resolved.

The environment variables are the first thing I tested and they seem to cover all bases.

Since I support a production that use both Mobu 7.5 and 2009 as well as 32bit and 64bit for both version it tends to create comflicts between librairies on my machine.

Apparently, if you install Python separately from Mobu on your machine, it has to match your mobu install. ie.: Mobu 32 bit goes with Python 32 bit and Mobu 64bit with Python 64 bit.
Even if I can have both Mobu 32 bit and 64 bit installed in the mean time, I can use only one version at the time according to the Python install I got.
Maybe having a complete version of Python, instead of a lite version, embedded in Mobu would fix this problem in the future.

Cheers,

Eric



Replies: 0