[C++-sig] boost_python_debug pulls in python24.dll => "ImportError: Module use of python24.dll conflicts with this version of Python" ?

Bill Davy Bill at SynectixLtd.com
Tue Dec 6 19:34:48 CET 2005


I am having trouble using boost_python.  The final error is:

>>> import PIF
# trying PIF_d.pyd
h:\kestrel\version1\pif\pif.cpp: process attached
h:\kestrel\version1\pif\pif.cpp: process detached
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Module use of python24.dll conflicts with this version of
Python.
[19235 refs]
>>>

But let me start a bit earlier ...

My main() loads a couple of DLL by hand using LoadLibraryEx(), successfully.
The first is the DLL I intend to wrap, the second is boost_python:

Trying LoadLibraryEx(H:\Kestrel\Version1\Machine\Debug\Machine.dll)
h:\kestrel\version1\machine\machine.cpp: process attached
<<<<<< message from DllMain() in Machine.dll
LoadLibraryEx(H:\Kestrel\Version1\Machine\Debug\Machine.dll) loaded

Trying
LoadLibraryEx(H:\Boost\boost_1_33_0\libs\python\build\bin-stage\boost_python
_debug.dll)
LoadLibraryEx(H:\Boost\boost_1_33_0\libs\python\build\bin-stage\boost_python
_debug.dll) loaded

And then I call PyMain():

Calling Py_Main()
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# trying H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.zip\site_d.pyd
# trying H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.zip\site_d.dll
# trying H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.zip\site.py
# trying H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.zip\site.pyw
# trying H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.zip\site.pyc
# trying C:\Python24\Lib\site_d.pyd
# trying C:\Python24\Lib\site_d.dll
# trying C:\Python24\Lib\site.py
# C:\Python24\Lib\site.pyc matches C:\Python24\Lib\site.py

Snip snip

I just want to get the encoding out of the way so let's say "hello":

>>> "hello"
# trying C:\Python24\Lib\encodings\cp850_d.pyd
# trying C:\Python24\Lib\encodings\cp850_d.dll
# trying C:\Python24\Lib\encodings\cp850.py
# C:\Python24\Lib\encodings\cp850.pyc matches
C:\Python24\Lib\encodings\cp850.py

import encodings.cp850 # precompiled from
C:\Python24\Lib\encodings\cp850.pyc
'hello'
[19197 refs]

And now to trigger the error:

>>> import PIF
# trying PIF_d.pyd
h:\kestrel\version1\pif\pif.cpp: process attached                    <<<<<<
message from DllMain() in PIF_d.pyd
h:\kestrel\version1\pif\pif.cpp: process detached                    <<<<<<
message from DllMain() in PIF_d.pyd
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Module use of python24.dll conflicts with this version of
Python.
[19235 refs]	
>>>

In the meantime, the MSVC window has noted the following comings and goings:

'RunPy.exe': Loaded 'H:\Kestrel\Version1\RunPy\Debug\RunPy.exe', Symbols
loaded.
'RunPy.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'RunPy.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'RunPy.exe': Loaded 'H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.dll',
Symbols loaded.       <<< Here is the Python interpreter
'RunPy.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'RunPy.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.

Snip snip

'RunPy.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'RunPy.exe': Unloaded 'C:\WINDOWS\system32\shimeng.dll'
'RunPy.exe': Loaded 'H:\Kestrel\Version1\Machine\Debug\Machine.dll', Symbols
loaded.
'RunPy.exe': Loaded
'H:\Boost\boost_1_33_0\libs\python\build\bin-stage\boost_python_debug.dll',
No symbols loaded.
'RunPy.exe': Loaded 'H:\Husky\HostPC\Python-2.4.1\PCbuild\python24.dll',
Symbols loaded.          <<<< Why this is loaded?
'RunPy.exe': Loaded 'C:\WINDOWS\system32\msvcr71.dll', Symbols loaded.
'RunPy.exe': Loaded 'C:\WINDOWS\system32\msvcp71d.dll', Symbols loaded.
'RunPy.exe': Loaded 'H:\Kestrel\Version1\RunPy\PIF_d.pyd', Symbols loaded.
'RunPy.exe': Unloaded 'H:\Kestrel\Version1\RunPy\PIF_d.pyd'


H:\Husky\HostPC\Python-2.4.1\PCbuild\python24_d.dll
07/06/2005  15:36
H:\Boost\boost_1_33_0\libs\python\build\bin-stage\boost_python_debug.dll
05/12/2005  15:25
H:\Husky\HostPC\Python-2.4.1\PCbuild\python24.dll
22/06/2005  11:33

I built boost_python_debug.dll using the following batch file:

H:\Boost\boost-jam-3.1.11-1-ntx86\bjam "-sVC71_ROOT=C:\Program
Files\Microsoft Visual Studio.NET 2003\Vc7" "-sPYTHON_VERSION=2.4"
--with-python-root=H:\Kestrel\Python-2.4.1

The batch files runs in the directory H:\Boost\ boost_1_33_0

So:
(1) boost_python_debug should be a debug version but it seems to pull in
python24.dll even though python24_d.dll was already loaded.
(2) I am getting "ImportError: Module use of python24.dll conflicts with
this version of Python", possibly as a result of (1).

I would be truly grateful for any assistance.

Thanks in advance,
   Bill

PS If there is a UK genius I am happy to pack up my laptop for a spot of
consultancy.  If I can get past these first few stumbling blocks, all will
be well.

~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,.~*""*~.,

Privileged/Confidential information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not copy or deliver this message to
anyone. In such case, you should destroy this message, and please notify us
immediately. Please advise immediately if you or your employer does not
consent to Internet e-mail for messages of this kind.

Opinions, conclusions and other information expressed in this message are
not given or endorsed by my firm or employer unless otherwise indicated by
an authorised representative independent of this message.

Although we utilise the most up to date virus checking procedures you should
carry out your own virus check before opening any attachment. We accept no
liability for any loss or damage which may be caused by software viruses.

~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,.~*""*~.,

Bill Davy, Synectix Limited, 12 King Alfred Way, Cheltenham, GL52 6QP,
England

Telephone: +44 (0)1242 254411, Mobile: +44 (0)7866 451568, Fax: +44 (0)1242
256611

Work: mailto:Bill at SynectixLtd.com

Home: mailto:Bill at XchelSys.co.uk

Web: http://www.synectixltd.com/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 7966 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20051206/079b30ec/attachment.bin>


More information about the Cplusplus-sig mailing list