code-google-com / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

Maya 2013 #274

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some of our in-house tools fail with Maya 2013. One of them is a patched MtoA 
(Maya to Arnold) version, but other tools relying on PyMel fail as well with 
the following message (that message is from MtoA, but see below for a simpler 
example):

Maya 2013 importing module pymel 1.0.4 
(/mill3d/server/apps/CUSTOMS/MAYA/2013/scripts-linux/millPython/pymel/__init__.p
yc)
# Error: line 1: No module named _md5
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File 
"/mill3d/server/apps/ARNOLD/mtoa/maya-2013/arnold-4/scripts/mtoa/cmds/registerAr
noldRenderer.py", line 32, in <module>
#     import pymel.core as pm
#   File 
"/mill3d/server/apps/CUSTOMS/MAYA/2013/scripts-linux/millPython/pymel/core/__ini
t__.py", line 19, in <module>
#     import pymel.api.plugins as _plugins
#   File 
"/mill3d/server/apps/CUSTOMS/MAYA/2013/scripts-linux/millPython/pymel/api/plugin
s.py", line 20, in <module>
#     import hashlib
#   File 
"/mill3d/server/apps/MAYA/linux-x86-64/maya2013/lib/python26.zip/hashlib.py", 
line 136, in <module>
#   File 
"/mill3d/server/apps/MAYA/linux-x86-64/maya2013/lib/python26.zip/hashlib.py", 
line 63, in __get_builtin_constructor
# ImportError: No module named _md5 # 

What Version of Maya are you using? 2013

On what operating system? linux-x86-64

What Version of PyMEL are you using? pymel 1.0.4

The problem seems to be independent of MtoA. A simple import of pymel.core 
fails:

import pymel.core
# Error: No module named _md5
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File 
"/mill3d/server/apps/CUSTOMS/MAYA/2013/scripts-linux/millPython/pymel/core/__ini
t__.py", line 19, in <module>
#     import pymel.api.plugins as _plugins
#   File 
"/mill3d/server/apps/CUSTOMS/MAYA/2013/scripts-linux/millPython/pymel/api/plugin
s.py", line 20, in <module>
#     import hashlib
#   File 
"/mill3d/server/apps/MAYA/linux-x86-64/maya2013/lib/python26.zip/hashlib.py", 
line 136, in <module>
#   File 
"/mill3d/server/apps/MAYA/linux-x86-64/maya2013/lib/python26.zip/hashlib.py", 
line 63, in __get_builtin_constructor
# ImportError: No module named _md5 # 

Cheers,

Jan @ The Mill

Original issue reported on code.google.com by jdb.wal...@gmail.com on 19 Apr 2012 at 4:04

GoogleCodeExporter commented 9 years ago
the problem here is pymel uses a few standard python libraries - hashlib, in 
this case - which don't work on certain combinations of linux distributions / 
maya

To check if this is the case, fire up mayapy, and just do:

import hashlib

OR

import _md5

Generally, if these don't work it's because maya was compiled with a version of 
some library - usually libcrypto.so or libssl.so - that differs than the 
version on your linux distro.

When you try to import hashlib or _md5, it should print out some sort of error 
message saying which version of which library it failed to find.  You then need 
to find a compatible version of libcrypto / libssl, and throw it in maya's lib 
dir.

In one case, maya wanted libssl.so.6 and libcrypto.so.6, so I found an old 
fedora 8 rpm (searched http://rpm.pbone.net/ to find 
archive.fedoraproject.org/fedora/linux/releases/8/Fedora/x86_64/os/Packages/open
ssl-0.9.8b-17.fc8.x86_64.rpm). Then I extracted that rpm with

rpm2cpio openssl-0.9.8b-17.fc8.x86_64.rpm | cpio -idmv

...and placed those 2 files in maya's /lib directory.  Alternatively, you can 
try making a symlink from the version of libssl/libcrypto to the version maya's 
looking for (if you're sure the versions are compatible).

To help alleviate such issues in the future, I recently made a commit which 
moves the import of hashlib in pymel.api.plugins inside of the function which 
needs it; this way, pymel as a whole should still work even if hashlib isn't... 
you just won't be able to use some of pymel's plugin api functions.

Original comment by elron...@gmail.com on 22 Jun 2012 at 1:08

GoogleCodeExporter commented 9 years ago
My workaround here:

1) I noticed that libcrypto.so.6 and libssl.so.6 already exist in 
~maya2013/lib. They are symbolics to ~maya2013/support/openssl
2) hashlib still can't get _md5 imported. After digging into 
~maya2013/lib/python26.zip, I noticed that what we really need is _hashlib 
instead of _md5.
3) try import _hashlib and you will noticed that what's missing is 
libcrypto.so.10 and libssl.so.10
4) go to ~maya2013/lib, and do symbolic link to ~maya2013/support/ with .10 
naming.

cd ~maya2013/lib
ln -sf ../support/openssl/libcrypto.so.6 libcrypto.so.10
ln -sf ../support/openssl/libssl.so.6 libssl.so.10

Original comment by drake.guan on 31 Aug 2012 at 3:15

GoogleCodeExporter commented 9 years ago
Marking as fixed due to the changes in 8c00e04582fc7d58cd5f5c4d81e3158893598323

Original comment by elron...@gmail.com on 17 Sep 2012 at 4:57