No module named when using PyInstaller
The problem were some runtime dependencies of matplotlib. So the compiling was fine while running the program threw some errors. Because the terminal closed itself immediately I didn't realize that. After redirecting stdout
and stderr
to a file I could see that I missed the libraries Tkinter
and FileDialog
. Adding two import
s at the top of the main solved this problem.
Trouble using pyinstaller No module named '_ssl'
I finally find the solution.
For people who facing the same trouble:
Here is the command I use for create the binary file:
pyinstaller --hidden-import _ssl --hidden-import engineio.async_gevent --hidden-import engineio.async_eventlet --hidden-import ssl ./server_websocket.py -y
I also need to modify the socketIO call:
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app, async_mode='gevent')
And import that:
from engineio.async_drivers import gevent
How to fix a pyinstaller 'no module named...' error when my script imports the modules pikepdf and pdfminer3?
I found a solution to this error:
No module named 'pikepdf._cpphelpers'
Simply add:
from pikepdf import _cpphelpers
To the top of your script
No module named PyInstaller' after what appears to be a successful install
Although I do not fully undestand the reason behind it, it seems like the --no-cache-dir
option was causing the issue. The dockerfile below builds without an issue:
FROM debian:buster
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip
RUN python3 -m pip install PyInstaller==3.5
RUN python3 -m PyInstaller --help
Edit: This seems to be an issue outside of PyInstaller, but with the specific version of pip, see https://github.com/pyinstaller/pyinstaller/issues/6963 for details.
Related Topics
How to Highlight Specific X-Value Ranges
How to Change the Host and Port That the Flask Command Uses
Django JSONfield Inside Arrayfield
How to Upload a File to Directory in S3 Bucket Using Boto
Determine Complete Django Url Configuration
Django Model Field Default Based Off Another Field in Same Model
Use of True, False, and None as Return Values in Python Functions
Overwriting File in Ziparchive
Python: Read Lines from Compressed Text Files
Re.Sub Erroring with "Expected String or Bytes-Like Object"
Python Saving Multiple Figures into One PDF File
Extract a String Between Double Quotes
Matplotlib - Add Colorbar to a Sequence of Line Plots
What Is Sys.Maxint in Python 3
Pip Connection Failure: Cannot Fetch Index Base Url Http://Pypi.Python.Org/Simple/