hobuinc / mgrs

Python MGRS library
https://pypi.python.org/pypi/mgrs
MIT License
111 stars 36 forks source link

PyInstaller error: mgrs.core.MGRSError: Unable to load libmgrs.cp37-win_amd64.pyd #36

Closed cpetruzelli closed 3 months ago

cpetruzelli commented 2 years ago

I see other people are using windows and pyinstaller but I have not been able to resolve this issue. I installed mgrs into my venv and I'm trying to use pyinstaller to create an .exe. When I run the exe I get the following error:

mgrs.core.MGRSError: Unable to load libmgrs.cp37-win_amd64.pyd

I am using mgrs v1.4.2 and pyinstaller v4.2. I'm hoping someone has a solution for me. I tried the solution @uetacog proposed in issue #32 with no luck.

sss7526 commented 3 months ago

I am using python 3.12 on windows and I got the same error using pyinstaller when trying to launch the executable: "mgrs.core.MGRSError: Unable to load libmgrs.cp312-win_amd64.pyd."

I resolved it by adding this flag to the pyinstaller build command: "--add-binary venv\Lib\site-packages\libmgrs.cp312-win_amd64.pyd:."

hobu commented 3 months ago

mgrs 1.5.0 was just released that should include new wheels. please test and open a new ticket if there are any issues.