bastibe / transplant

Transplant is an easy way of calling Matlab from Python
https://transplant.readthedocs.io
Other
110 stars 26 forks source link

When I use “pyinstaller” to export py as exe, it shows the following #100

Open haaabb opened 2 years ago

haaabb commented 2 years ago

Traceback (most recent call last): File "mainwindow.py", line 40, in matlab = transplant.Matlab(jvm=False) File "transplant\transplant_master.py", line 542, in init File "transplant\transplant_master.py", line 711, in _locate_libzmq RuntimeError: could not locate libzmq for Matlab

When I run the program in pycharm, it runs normally, but after packaging it into an exe file, the exe file cannot run normally. Thank you very much!!!

bastibe commented 2 years ago

You probably need to install libzmq. How did you install it originally?

haaabb commented 2 years ago

I remember that I installed the library with anaconda. I have no problem running it on pycharm, but the above problem occurs after packaging it into an exe

haaabb commented 2 years ago

I tried to put libzmq.dll directly to the path of the exe file, the above error is gone, but a new error appears, it shows "error loading libzmq.dll", it prompts me to need a compiler, but I have installed MinGW, and added to PATH, I don't understand why it's not working

bastibe commented 2 years ago

As you can see in the code, transplant searches for libzmq in your PATH, and in C:/Program Files/ZeroMQ*/bin (which is the default directory if you install libzmq using the official installers from http://wiki.zeromq.org/intro:get-the-software).

If Matlab can't find an appropriate compiler, try installing MinGW in Matlab's own app store thing. That seems to work relatively reliably.