Helge Posted February 3, 2022 Share Posted February 3, 2022 Hello, I fail to run a python script which worked on a different computer and I simply cannot figure out where is the problem. Enclosed you find python script database settings for path variables output on the command line In case it is important: I am working from remote ("Home Office") on the computer where the executables are located. Many thanks, Helge python-problem.zip Quote Link to comment Share on other sites More sharing options...
Jia Wang Posted February 3, 2022 Share Posted February 3, 2022 Hello Helge, Thank you for providing the files for your run. I believe the path to the GWB folder is added correctly from your screenshot. A possible issue comes to mind. If you are using python 3.8+, the dll search behavior was changed from previous versions such that python no longer looks in PATH for dlls that modules might need. Please try adding the bolded part below to your python script and try rerunning. # To find the plugin sys.path.append('c:/program files/gwb/src') import os os.add_dll_directory('c:\program files\gwb') from GWBplugin import * It seems to solve the issue when I tried it on my machine (currently running python 3.10). If that didn't help to resolve the issue, could you please double check that you are using the same version of python as the GWB installed (64-bit vs 32-bit)? Are you using any Windows emulator software to run GWB? Is the GWB installed on your work machine that you're remotely connecting or on your home office machine? Hope this helps, Jia Wang Aqueous Solutions LLC Quote Link to comment Share on other sites More sharing options...
Helge Posted February 4, 2022 Author Share Posted February 4, 2022 Dear Jia, thanks for the advice, it works. The beginning of the script now reads #!/usr/bin/env python import os, glob, sys, string, math # To find the plugin sys.path.append('c:/program files/gwb/src') os.add_dll_directory('c:/program files/gwb') # import GWBplugin class from GWBplugin import * Indeed the problem didn't arise with a colleague who uses python 3.8 (I am using 3.10). Best regards, Helge Quote Link to comment Share on other sites More sharing options...
Jia Wang Posted February 4, 2022 Share Posted February 4, 2022 Hello Helge, You're welcome. I am glad this resolved the issue. Best, Jia Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.