jgerstmayr / EXUDYN

Multibody Dynamics Simulation: Rigid and flexible multibody systems
https://www.youtube.com/channel/UCsQD2bIPBXB_4J23WtqKkVw/playlists
Other
166 stars 23 forks source link

ModuleNotFoundError #50

Closed Jiang-Cui closed 1 year ago

Jiang-Cui commented 1 year ago

Dear professor,

Before, I have successfully installed Exudyn and use the C++ source code in the platform of Windows 10, VS2017, and python 3.7.9.

I now install the Exudyn in Windows 11 using the same steps using VS2017 and python 3.7.9. The cpp project can be successfully compiled, but an error occured in debugging process. When I click "start execution without debugging" to debug the pytest.py, the following error are shown. This same error occurs before when I used VS2022. 4a9932ffcf17be6b93d9c94a58d209b

Coud you help me to solve this error? Thank you very much!

jgerstmayr commented 1 year ago

This is very likely a path problem in your VS2017 project (which may be different on Windows 10 and 11, or just in your installation). Possibly, you have to specify the path of the python lib or similar in the configuration. Even if the output of this exception looks very complicated, it simply fails at the point where exudynCPP.pyd is loaded. You could also try to copy it into some local directory, e.g. where pytest.py is located. This would show you that you have a problem with the definition of the path.

Jiang-Cui commented 1 year ago

Thank you very much, Professor! I have copied the new exudynCPP.pyd to the file where the pytest.py is located, but the error occurred in Windows 11. Is there another way to solve the error?

jgerstmayr commented 1 year ago

First you can simplify the __init__.py file to:

try:
    from .exudynCPP import *
except:
    from exudynCPP import *

This should avoid any extra error messages. In my version, VS2017 imports via the second case "from exudynCPP import *", while in the installed exudyn, it imports via "from .exudynCPP import *". I assume that you have two Python versions (one installed and one in VS2017). They may be incompatible (e.g. 3.6 and 3.7 or 32/64 bit). For this reason, in the first line of __init__.py, you could just add: print(sys.version) In your compiler settings, you can cross-check if you are using the same version and bits for compilation.

Jiang-Cui commented 1 year ago

Dear Professor,

I have simplify the init.py, and add print(sys.version). It seems that this cannot work, as shows

b51d587bcc1f69219f087695652c4d3

The information of CPU is "13th Gen Intel(R) Core(TM) i9-13900HX 2.20 GHz".

jgerstmayr commented 1 year ago

Now you can just check if 3.7 64bits agrees with your compiled .pyd version (check your VS2017 settings).

Another possible issue is that you changed something in exudyn. Did you? Commonly, if you are doing something wrong in the interface (e.g. failing to supply a API-function in the library correctly), this will raise a DLL load failed message without further information. A workaround is to use a linux compilation, where gdb shows the missing API function.

Otherwise, it is a problem with directory settings in VS2017/Windows11 and you have to look there to resolve problems. This is not an exudyn problem anymore.

Jiang-Cui commented 1 year ago

Dear Prof. Gerstmayr,

Thanks for you reply. I have downloaded the latest code from github, the "ModuleNotFoundError" problem dose not exist. Thank you very much!