简体   繁体   中英

PyInstaller: “ImportError: No module named htmlentitydefs”

I made the executable with pyinstaller like this (no --onefile or other options)

> pyinstaller brdg2.py

When i run it, here's what i get (screenshot of the command prompt before it closed).

From other threads, the warning at the start seem to be ignorable, so the problem would be

ImportError: No module named htmlentitydefs

Edit: I get the same ImportError with an .exe created with cx_freeze, so it doesn't seem related to the packaging programm.

Also to add some information i had just reinstalled Python and the necessary modules, and i didn't get this error when doing the same operations before (i did get other errors though).

The htmlentitydefs module has been renamed to html.entities in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

Use html.entities instead of htmlentitydefs

https://docs.python.org/3/library/html.entities.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM