Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 476
sewdio Avatar asked Jan 03 '14 12:01

sewdio


1 Answers

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

like image 55
Sadaf Niknam Avatar answered Oct 04 '22 02:10

Sadaf Niknam