In your project settings, link tab, output, for your debug build, add the
'_d' to the module name.
When Python_d looks for your module, it looks for BGI_Objects_d.
Tom.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of David
> Humphrey
> Sent: April 9, 2001 7:34 PM
> To: '[EMAIL PROTECTED]'
> Subject: Problem importing a module with python_d
>
>
> 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\Sy
> stem;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
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython