Lucas Francklin
Lucas Francklin

Reputation: 75

auto py to exe module not found ezdxf

Tried to make exe in a file, and its not import the ezdxf module correctly.

I am using spyder by anaconda.

the error:

    Traceback (most recent call last):
  File "Conversor - Tkinter.py", line 3, in <module>
  File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
  File "TXT_DXF.py", line 9, in <module>
ModuleNotFoundError: No module named 'ezdxf'

I already tried go to --hidden-import but it didnt work and i think i know why.

All other module have their file exactly by the same name they are called.

Ex: Import glob has a file named glob.

but the ezdxf brings to a folder called ezdxf and the direct file name is a init in that folder. Like the photo: enter image description here

Upvotes: 0

Views: 2283

Answers (1)

zChris128
zChris128

Reputation: 21

I'd reccomend using pyinstaller. It works well with hidden imports.

If you use pyinstaller, you can add this ezdxf library to the CWD of your project.

Once you add it, you can run CD C:/your/project/path, then pyinstaller --onefile --hidden-import=ezdxf my_script_name.py

This should create your exe with the module, and it'll be able to find it cus its in the same folder you're making the exe from.

If auto-py-to-exe involves changing the directory (CD) then you can drag the ezdxf module there and continue using the auto-py-to-exe

Upvotes: 0

Related Questions