when import the mh,error with "ImportError: DLL load failed"

MakeHuman python API, python plugins, etc

Moderator: joepal

Re: when import the mh,error with "ImportError: DLL load failed"

Postby gsnake » Sat Feb 06, 2010 6:58 pm

The makehuman alpha4 I download is exe,I run the main.py in the floder of the exe installed after I install all the file you tell me.
it still said that it has something wrong with the mh. the message is just as below,where can I download the C code of the mh.pyd configure with this version ?
>>>
Traceback (most recent call last):
File "F:\Program Files\Makehuman\main.py", line 295, in <module>
application = MHApplication()
File "F:\Program Files\Makehuman\main.py", line 74, in __init__
modelCamera = mh.Camera()
AttributeError: 'module' object has no attribute 'Camera'


jcapco wrote:
I use xp sp3 ,my IE is IE8,So I must to find the dll's my environment missing ?


Before doing that I suggest you to:

1. Download makehuman alpha4
2. Download Microsoft Visual C++ 2005 SP1 Redistributable Package
3. Uninstall your Python 2.6 (because we want to reregister the dll and redo the system paths here)
4. Reinstall Python 2.6.4
5. Install Microsoft Visual C++ 2005 SP1 Redistributable Package
6. Install makehuman alpha4
7. Now try to import mh ..make sure your sys.path has a directory to makehuman alpha4:
Example code:
Code: Select all
import sys
sys.path.append("F:\makehuman1-0-0_alpha4_win32")
import mh


After you did all these, please tell us the result :) :ugeek:
gsnake
 
Posts: 27
Joined: Sat Feb 06, 2010 6:17 am

Re: when import the mh,error with "ImportError: DLL load failed"

Postby jcapco » Sat Feb 06, 2010 7:12 pm

The makehuman alpha4 I download is exe,I run the main.py in the floder of the exe installed after I install all the file you tell me.
it still said that it has something wrong with the mh. the message is just as below,where can I download the C code of the mh.pyd configure with this version ?


I am not sure from where the library is generated. We have to wait for Manuel or Marc to answer that. Does it return the same error if you use this version of mh.pyd?
Last edited by jcapco on Sat Feb 06, 2010 7:20 pm, edited 1 time in total.
jcapco
 
Posts: 157
Joined: Wed Jan 13, 2010 6:26 pm

Re: when import the mh,error with "ImportError: DLL load failed"

Postby jcapco » Sat Feb 06, 2010 7:17 pm

I think I know now how Manuel created mh.pyd :D .. see this post. Here is his source code.
jcapco
 
Posts: 157
Joined: Wed Jan 13, 2010 6:26 pm

Re: when import the mh,error with "ImportError: DLL load failed"

Postby mflerackers » Sun Feb 07, 2010 2:12 am

No no, mh.pyd is made from the same source as makehuman.exe, just with a different #define to make some changes. To build it just build the makehuman source as a dll, but define MAKEHUMAN_AS_MODULE, then rename .dll to .pyd.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: when import the mh,error with "ImportError: DLL load failed"

Postby gsnake » Sun Feb 07, 2010 3:21 am

Yes ,it returns the same error.

Traceback (most recent call last):
File "F:\Program Files\Makehuman\main.py", line 295, in <module>
application = MHApplication()
File "F:\Program Files\Makehuman\main.py", line 74, in __init__
modelCamera = mh.Camera()
AttributeError: 'module' object has no attribute 'Camera'



jcapco wrote:
The makehuman alpha4 I download is exe,I run the main.py in the floder of the exe installed after I install all the file you tell me.
it still said that it has something wrong with the mh. the message is just as below,where can I download the C code of the mh.pyd configure with this version ?


I am not sure from where the library is generated. We have to wait for Manuel or Marc to answer that. Does it return the same error if you use this version of mh.pyd?
gsnake
 
Posts: 27
Joined: Sat Feb 06, 2010 6:17 am

Re: when import the mh,error with "ImportError: DLL load failed"

Postby gsnake » Sun Feb 07, 2010 8:45 am

When I build the mh myself,it said that the C files don't define some functions,Do you know where can download the correct version of mh source code?

-----------------------------------------------
error report:


reference to `SDL_InitSubSystem'
build\temp.win32-2.6\Release\src\glmodule.o:glmodule.c:(.text+0x1f4f): undefined
reference to `SDL_AddTimer'
build\temp.win32-2.6\Release\src\glmodule.o:glmodule.c:(.text+0x1f93): undefined
reference to `SDL_WaitEvent'
build\temp.win32-2.6\Release\src\glmodule.o:glmodule.c:(.text+0x1fc7): undefined
reference to `SDL_WM_GrabInput'
build\temp.win32-2.6\Release\src\glmodule.o:glmodule.c:(.text+0x211b): undefined
reference to `SDL_SetVideoMode'
build\temp.win32-2.6\Release\src\main.o:main.c:(.text+0x34b): undefined referenc
e to `SDL_GetMouseState'
build\temp.win32-2.6\Release\src\main.o:main.c:(.text+0x380): undefined referenc
e to `SDL_GetMouseState'
collect2: ld returned 1 exit status

mflerackers wrote:No no, mh.pyd is made from the same source as makehuman.exe, just with a different #define to make some changes. To build it just build the makehuman source as a dll, but define MAKEHUMAN_AS_MODULE, then rename .dll to .pyd.
Last edited by gsnake on Sun Feb 07, 2010 10:11 am, edited 1 time in total.
gsnake
 
Posts: 27
Joined: Sat Feb 06, 2010 6:17 am

Re: when import the mh,error with "ImportError: DLL load failed"

Postby mflerackers » Sun Feb 07, 2010 9:54 am

It's because you didn't download sdl. Download lib sdl from http://www.libsdl.org/download-1.2.php. Both devel and runtime packages.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: when import the mh,error with "ImportError: DLL load failed"

Postby gsnake » Sun Feb 07, 2010 11:17 am

I have put the sdl.dll in the folder and include the relevant header
files,It still does't take effort!

mflerackers wrote:It's because you didn't download sdl. Download lib sdl from http://www.libsdl.org/download-1.2.php. Both devel and runtime packages.
gsnake
 
Posts: 27
Joined: Sat Feb 06, 2010 6:17 am

Re: when import the mh,error with "ImportError: DLL load failed"

Postby jcapco » Sun Feb 07, 2010 12:33 pm

I have put the sdl.dll in the folder and include the relevant header
files,It still does't take effort!


You have to put SDLmain.lib, SDL.lib, glu32.lib and opengl32.lib in your library modules of the Project settings (are you using Visual C++ to build?).
jcapco
 
Posts: 157
Joined: Wed Jan 13, 2010 6:26 pm

Re: when import the mh,error with "ImportError: DLL load failed"

Postby gsnake » Sun Feb 07, 2010 12:55 pm

No ,I use python and mingw32 build,So I put the sdl.dll,freeglut.dll,gdi32.dll,wimm.dll ,opengl32.dll Into folder to build mh.


jcapco wrote:
I have put the sdl.dll in the folder and include the relevant header
files,It still does't take effort!


You have to put SDLmain.lib, SDL.lib, glu32.lib and opengl32.lib in your library modules of the Project settings (are you using Visual C++ to build?).
Last edited by gsnake on Sun Feb 07, 2010 1:14 pm, edited 1 time in total.
gsnake
 
Posts: 27
Joined: Sat Feb 06, 2010 6:17 am

PreviousNext

Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest