Reputation: 23
I'm trying to package up my python file into an .exe file using pyinstaller.
I managed to install pyinstaller with pip but when trying to use pipinstaller in a command window it wouldn't work. I found online to use python -m PyInstaller
instead which then worked. But after using cd to change the directory and then doing python -m PyInstaller filename.py
it would always give a list of errors saying 1920, 'LoadLibraryExW', 'The file cannot be accessed by the system.'
.
I'm using windows 10, python 3.8.3 and the newest version of pip but I couldn't find a soloution. I ran command prompt as an operator but it still wouldn't help.
Any soloutions?
Upvotes: 2
Views: 17702
Reputation: 23
I decided to try another one after failing to use pyinstaller. I used py2exe and shortly after trying managed to convert it into an .exe file along with moving my files inside of where my python was stored.
Upvotes: 0
Reputation: 1985
Go to the path you've installed your python
if you don't know where you installed python, in the console type 'where python'
> where python
C:\Users\{username}\AppData\Local\Programs\Python\Python38\python.exe
then go to the path
next, go to 'Scripts' folder
cd Scripts
in the Scripts folder, make sure there is pyinstaller.exe file there
if you find pyinstaller.exe in this folder, you are sure pyinstaller is installed on your system, then
> pyinstaller {path to the main.py}
there is two useful switch for pyinstaller
For eg:
pyinstaller d:\myapp\main.py --onefile
You can find your final dot.exe file in the 'dist' folder in 'Scripts' folder
Upvotes: 4
Reputation: 1
I encounter the same question, so I uninstall python which is installed from windows appstore, and reinstall it from the website, and it works fine now, hope it help
Upvotes: 0