I want to use pyinstaller to make standalone exe files. I used
pip install pyinstaller
first, then I got an error message I will show you in a second, so I used
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
because I found it on a pyinstaller website. So I cd into the folder my script is in, and I think you don't need a setup.py file or anything for pyinstaller like you would need using py2exe, then I use the command
pyinstaller file.py --onefile
and I get the error message (I am translating the last part so it is not 100% accurate)
Fatal error in launcher: Unable to create process using '"c:\python\python.exe" "C:\Python\Scripts\pyinstaller.exe" gtaReminder.py --onefile': System could not find the specified file.
I think pyinstaller thinks that python.exe is located in c:\python\python.exe as it says in the error message. I just opened the path and it is not. Can I somehow change this path pyinstaller thinks it can find python.exe in? I am using python 3.6.2, pip 20.3.3 on windows 10.
Firstly, your command line syntax is wrong, it is always supposed to be optional arguments followed by the mandatory arguments, below is the general syntax
pyinstaller [options] script [script …] | specfile
Read the documentation here.
The correct command should be
pyinstaller --onefile file.py
The error does not suggest that pyinstaller has got the wrong python file, the fact that it could tell
Unable to create process using '"c:\python\python.exe" "C:\Python\Scripts\pyinstaller.exe"
means that it was able to find the python file and tried initiating the process but failed to perform the task altogether.
Related
[So I have previously used nuitka to create standalone executables for my python scripts and had no issue until this time I tried once again]
I am trying to use nuitka to create a .exe file for my .py script however, it throws the following error:
Nuitka:INFO: Starting Python compilation.
__main__.py: can't open file 'MyPythonProgram.py'.
I have given the following command in the command prompt (run as administrator and in the correct directory):
nuitka --mingw --follow-imports MyPythonProgram.py
I have also tried using --onefile --windows-onefile-tempdir and standalone however the result was the same.
I am using python 3.9.4 and nuitka 0.6.14.4. (Same as last time when it actually worked without throwing any errors)
So let me know, what went wrong with my attempt and how to fix it...
Thanks in advance!
I just finished working on a PyCharm project (using python 3.7), which uses libraries downloaded using PyCharm's built in functionality. I just want to send this project to my boss so that he can simply run it by clicking on it, without having to go through downloading PyCharm and downloading the applicable packages. Please tell me that there is a way to do this. Thank you
if you want to convert your python project to a program exucutable in windows you can use the library pyinstaller.
install the library:
pip install pyinstaller
then in the path of the project,open a command console and type the following commands.
if you want the executable in one file(slower start):
pyinstaller.exe --onefile --windowed --icon="your_icon_file".ico "your_python_script".py
if you want the executable in one folder(faster start):
pyinstaller.exe --onedir --windowed --icon="your_icon_file".ico "your_python_script".py
this wil create a folder call "dist" where your .exe will be,
pd: whith the --onedir command you will see all your dependencies in that folder, if you have a simple script you can use the first option.
Link to the pyinstaller documentation:https://pypi.org/project/pyinstaller/
You could solve this issue by converting the .py file to an executable file or .exe file....
Hopefully it helped..thx
A simple way to that would be sharing it on github with a requirements.txt file containing all the dependencies which then can be installed using python -m pip install -r requirements.txt.
Or You can use pyinstaller --onefile <yourfile.py> to create a .exe file which could be run without any requirements on windows.
I have coded a program in Python 3.5 that uses the Tkinter import. I'm trying to figure out a way to run it on computers that don't have Python. First I tried freezing it but I haven't been able to because none of the freezing tools I found support Python 3.5. Then I tried possibly using a online idle but I couldn't find any that support Tkinter. I would prefer to be able to get a .exe file or something similar but if I could run it online that would be good too any ideas?
EDIT
So I have now successfully downloaded PyInstaller using pip. My current problem is when I type this into the console: pyinstaller.exe --onefile --windowed Finder.py
I get this error: 'pyinstaller.exe' is not recognized as an internal or external command,
operable program or batch file.
EDIT
I have now found the pathway to pyinstaller.exe. Now when I try to use it it says Access is denied.
I finally figured it out after about three days of work. Fist I downloaded PyInstaleller in the zipped form and extracted it. Then I put my program in the PyInstaller folder. Then I opened a regular command prompt. I then typed cd then the location of the PyInstaller folder. Finally I typed pyinstaller.py --one file --windowed program.py. Then when I went into the PyInstaller folder there was a folder called program with the .exe file in the dist folder. Thanks everyone for all of your help!
You can use pyinstaller to do that. I think its work fine on linux em linux.
Another option is use py2exe.
Try pyinstaller -F -w Finder.py as the command or you could check out CxFreeze.
I'm trying to use this module in a project, but can't figure out how to use it.
What I've tried:
Downloaded the module as a ZIP file.
Unzipped that file, giving me the directory structure I saw in the GitHub page.
Opened up Terminal, and navigated to the directory with setup.py in it.
Ran the command sudo python setup.py install
This seemed to run fine, as I get a message saying "Finished processing dependencies"
Now, when I go into PyCharm (the IDE I'm using) and try to run import readability I get an error saying ImportError: No module named 'readability'
Possible reason for failure:
I specified to PyCharm that I am using a Python 3 interpreter. Would Terminal by default install in the 2.x Python directory?
Does the location of my PyCharm .py file matter?
My main error was running the python commands in Terminal under version 2.7.2. By using the keyword python3 instead of python, I was able to force Terminal to use the correct version. I also needed to install setuptools.
I am a python noob, so this may be a stupid question, but when I tried to use cxfreeze to export a python script to exe (using python 3.3) I get this:
cxfreeze.py: error: script or a list of modules must be specified
This is the command I was using:
cxfreeze.py script.py --target-dir dist
The script had been copied into the C:\Python33\Scripts directory. What am I doing wrong here?
I had a similar command working... then it stopped. Turns out that adding C:\Cygwin64\bin to my path causes that message to come up and without cx_Freeze works fine. Note that I do have both Windows and Cygwin Python installs so I assume that my issue is related to conflicting libraries being found.
Note that I am actually calling MinGW Make from a cmd.exe prompt in Windows 7 against a makefile which calls cx_Freeze using Python 3.4.