Python will look for modulename_d.pyd. If you have modulename.pyd, that
isn't enough. You need the _d suffix. This allows you to run debug and
release versions of modules side by side just as you can run debug and
release versions of Python side by side.
David Humphrey wrote:
>
> I have a problem that has puzzled me for a couple of hours, so I need
> another set of eyes to help me see what I'm doing wrong. First, here's a
> little environment information:
>
> Windows NT 4.0 SP 6
> Intel PII-300 processor
> Activestate Python 2.0 Build 203
> Microsoft Visual C++ 6.0
>
> I have written an extension in C++ that loads and runs fine in the "Release"
> build, but I'm having trouble with the "Debug" build. I downloaded the
> debug build of Python 2.0.203 and think I set the paths correctly, but
> python_d complains that it can't find the module. Here's a little test code
> that demonstrates the problem:
>
> import sys
> import os.path
>
> print 'sys.path = %s' % sys.path
>
> fn = '%s\\BGI_Objects.dll' % sys.path[1]
> if not os.path.isfile(fn):
> print 'CANNOT find %s' % fn
> sys.exit(1)
> else:
> print 'FOUND %s' % fn
>
> import BGI_Objects
>
> Here's my cmd line session:
>
> E:\dev\src\BGI_Objects>path
> Path=d:\Utils\Python20_d\image\python;d:\Utils\Python20_d\image\System;C:\WI
> NNT\system32;C:\WINNT;C:\BGIUtils;D:\Utils\Python20\;D
> :\Utils\ULTRAE~1;D:\Utils\Perl\bin\;c:\OASISmontaj\bin;d:\dlh\bin
>
> E:\dev\src\BGI_Objects>set PYTHONPATH=e:\dev\lib\Debug;d:\dlh\bin
>
> E:\dev\src\BGI_Objects>python_d test.py
> Adding parser accelerators ...
> Done.
> sys.path = ['', 'e:\\dev\\lib\\debug', 'd:\\dlh\\bin',
> 'd:\\utils\\python20\\pythonwin', 'd:\\utils\\python20\\win32', 'd:\\utils\
> \python20\\win32\\lib', 'd:\\utils\\python20',
> 'd:\\utils\\python20\\lib\\plat-win', 'd:\\utils\\python20\\lib',
> 'd:\\utils\\pytho
> n20\\dlls', 'e:\\dev\\src\\bgi_objects',
> 'd:\\utils\\python20_d\\image\\python']
>
> FOUND e:\dev\lib\debug\BGI_Objects.dll
>
> Traceback (most recent call last):
> File "test.py", line 14, in ?
> import BGI_Objects
> ImportError: No module named BGI_Objects
> [1706 refs]
>
> E:\dev\src\BGI_Objects>
>
> I've convinced myself that the extension module BGI_Objects.dll resides in
> e:\dev\lib\debug, but python_d doesn't seem to agree. Can anyone out there
> see what I'm doing wrong?
>
> Regards,
> David Humphrey
> Manager, Software Development
> Bell Geospace, Inc
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activepython
--
Take a recipe. Leave a recipe.
Python Cookbook! http://www.ActiveState.com/pythoncookbook
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython