Running TexGen libraries and pyd files from python shell

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
Eric
Posts: 2
Joined: Tue Jun 02, 2009 8:43 am

Running TexGen libraries and pyd files from python shell

Post by Eric »

Hello everybody,

I am new on this forum and as a student I am beginner within python and TexGen environment. I would like to ask a question regarding python and TexGen connection and I wish someone could help me!

I work with windows XP and Python 2.6. I wrote a python script to create a textile with TexGen library and everything works well when I run my python script with TexGen. But when I run my script from Python Shell-command window I get this error message:

" Traceback (most recent call last):
File "C:\Documents and Settings\Eric\Desktop\Python Training\interlacement5\tri_smeshing.py", line 1, in <module>
from Core import *
File "C:\PROGRA~1\TEXGEN\PYTHON\LIBXTRA\TEXGEN\Core.py", line 7, in <module>
import _Core
ImportError: DLL load failed: The specified module could not be found. "

At line 7, in the Core.py file the command "import _Core" fails.
_Core is actually _Core.pyd file and stands in the same directory as my Core.py file. I included this directory in my python path the following way at the begining of my script:
import sys
sys.path.append("C:\Program Files\TexGen\Python\libxtra\TexGen")
from Core import *

I also added other directories to my python path trough windows environment variables, such as :
C:\Program Files\TexGen\Python\libstd
C:\Python26\DLLs
C:\Python26\Lib
C:\Python26\Lib\lib-tk

I don't know why python cannot import _Core.pyd (I think .pyd and .dll are quite the same) and why therefore I can't run my script directly from python rather than through TexGen.

Can someone find an answer?
I would be grateful.

Thanks in advance,

Eric.
Eric
Posts: 2
Joined: Tue Jun 02, 2009 8:43 am

Post by Eric »

Hello again,

Well I finally found the answer by myself. I replaced python 2.6 by python 2.5 since this version is used by TexGen. No more error message.

Eric.
Post Reply