0

I've read through the pyinstaller documentation a couple times but I still can't figure out how to solve this issue. The first line of my script imports a module import gurobipy as gb The executable gets built and then I go to run it and get this error:

  File "Final_Project.py", line 1, in <module>
    import gurobipy as gb
  File "c:\users\bugbe\appdata\local\continuum\anaconda3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\gurobipy\__init__.py", line 1, in <module>
  File "model.pxi", line 8, in init gurobipy
ModuleNotFoundError: No module named 'numbers'
[46000] Failed to execute script Final_Project

I've tried adding a hidden path so pyinstaller can find the full module gurobipy but it seems to grab everything and I still get this error. The gurobi folder contains a few types of file including applications, dlls, and a xml file. What am I missing?

Roshin Raphel
  • 2,612
  • 4
  • 22
  • 40
Bugbeeb
  • 2,021
  • 1
  • 9
  • 26
  • Try running dependency walker on it and then put a screenshot of missing DLL's, This is assuming windows since you have talked about DLL's here and also your file path – anand_v.singh May 14 '19 at 03:40
  • I ran dependency walker on the exe file but I got a lot of errors, I don't think it support windows 10 – Bugbeeb May 15 '19 at 02:14
  • Pyinstaller automatically grabs two relevant files: the gurobi81.dll and a python extension file called gurobipy. The extension file must be important but I'm not sure how it works – Bugbeeb May 15 '19 at 02:27
  • I got it! i followed this thread: https://stackoverflow.com/questions/49232117/using-pyinstaller-to-package-python-program-and-there-is-a-nomodulefinderror?rq=1 – Bugbeeb May 15 '19 at 02:57
  • Good that you found it, but yes dependency walker gives a lot of issues always, so no biggie, and yes you would have to learn how to sort through that. – anand_v.singh May 15 '19 at 08:22

0 Answers0