No module named when using PyInstaller
Had a similar problem with no module named FileDialog. Discovered that with version 3.2, I could use pyinstaller –hidden-import FileDialog … instead of modifying my main script.
Had a similar problem with no module named FileDialog. Discovered that with version 3.2, I could use pyinstaller –hidden-import FileDialog … instead of modifying my main script.
From your question you can presume that the structure of your project is as follows: ├── index.html ├── jquery.js ├── main.py ├── my_custom.js └── styles.css For your case there are 2 options: using –add-data import os import sys from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets def resource_path(relative_path): “”” Get absolute path to resource, works for dev … Read more
You have to modify your User PATH environment variable to include C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python36-32\Scripts. For how to add/modify your PATH environment variables, see this.
PyInstaller 3.3, Pandas 0.21.0, Python 3.6.1. I was able to solve this thanks to not-yet published/committed fix to PyInstaller, see this and this. AND keeping the ability to pack it into one executable file. Basically: Locate PyInstaller folder..\hooks, e.g. C:\Program Files\Python\Lib\site-packages\PyInstaller\hooks. Create file hook-pandas.py with contents (or anything similar based on your error): hiddenimports = … Read more
If you want to hide the console window, here is the documentation: This is how you use the –noconsole option python pyinstaller.py –noconsole yourscript.py If you need help using pyinstaller to get to the point where you need to use the –noconsole option here is a simple tutorial for getting there.
Well I guess I have found the solution for my own question, here is how I did it: Eventhough I was being able to successfully run the program using normal python command as well as successfully run pyinstaller and be able to execute the app “new_app.exe” using the command line mentioned in the question which … Read more
try setting up your environment with a virtualenv, and install in there only the required libraries some details on working with virtual env are here: https://virtualenv.pypa.io/en/stable/
You need double backslashes: From: song = path + ‘\music\\’ + selected_song To: song = path + ‘\\music\\’ + selected_song Or: song = f”{path}\\{music}\\{selected_song}”
Edit: I belive I found the solution to my problem. # -*- mode: python -*- a = Analysis([‘AMOS_Visualizer.py’], pathex=[‘C:\\Users\\elu\\PycharmProjects\\Prosjektet\\Forsok splitting’], hiddenimports=[], hookspath=None, runtime_hooks=None) for d in a.datas: if ‘pyconfig’ in d[0]: a.datas.remove(d) break a.datas += [(‘Logo.png’,’C:\\Users\\elu\\PycharmProjects\\Prosjektet\\Forsok splitting\\Logo.png’, ‘Data’)] pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name=”AMOS_Visualizer.exe”, debug=False, strip=None, upx=True, console=True, icon=’C:\\Users\\elu\\PycharmProjects\\Prosjektet\\Forsok splitting\\AMOS.ico’) … Read more
As others (@Anson Chan, @schlimmchen) have said: If you want to add some extra files, you should use Adding Data Files. Two ways to implement Command Line: add parameter to –add-data Spec file: add parameter to datas= Generated when running pyinstaller the first time. Then later you can edit your *.spec file. Then running pyinstaller … Read more