MSLNZ / msl-loadlib

Load a shared library (and access a 32-bit library from 64-bit Python)
MIT License
75 stars 17 forks source link

Server32Error thrown #34

Closed amarco closed 1 year ago

amarco commented 1 year ago

I was happily building up a client/server solution to a thirdparty c dll. I was able to use the msl libray to execute many of the methods in the third party dll (32bit) from within 64 bit python and thought I was making good progress. I am now dead in my tracks with an exception in Server32

File 'c:\WinPython\WPy64-31110\python-3.11.1.amd64\Lib\site-packages\numpy\init.py', line 124, in from numpy.config import show as show_config AttributeError: module 'os' has no attribute 'add_dll_directory'

Oddly I am not calling or using any numpy features in my client or server code which inherits form Client64 or Server32. Any suggestions as I am at a total loss on this.

Marco

jborbely commented 1 year ago

I have seen something similar before. Some other dependency was trying to load numpy even though numpy wasn't used in the Client64/Server32 code. Could you try the suggestion here and see if that fixes the issue. Hopefully, this will tell the 32-bit server that numpy is not available.

FYI, the 32-bit server is running on Python 3.7.10 and os.add_dll_directory() was not added until Python 3.8, see docs, so this explains the reason for the AttributeError.

amarco commented 1 year ago

ok, I know I want to eventually use numpy (make life easier ;) ), is there a way to get the 32bit server to use a more current python which would then have a more current?

amarco commented 1 year ago

I downloaded 32bit version of latest python and recreated the server32, followed the freeze process and everything now works as expected and I can use numpy :)