Pyinstaller raises error: system cannot access the file - python

I'm having some trouble using pyinstaller to generate executables. After using the command pyinstaller --onefile "filename.py", an error is raised, mentioning that the system cannot access the file, as follows:
As anyone dealt with such problem before?

Pyinstaller reads a Python script written by you. For the majority of programs, this can be done by: pyinstaller yourscript.py
But if it doesn't work for you, try using this: pyinstaller --onefile --windowed yourscript.py

Related

Pyinstaller Error when running executable after build = "Pyarrow.vendored.version"

I built an executable file using PyInstaller and ran into a "pyarrow.vendored.version" error while running the executable output. Does anyone have any idea how to get around this issue? It seems to be something that is installed during the pyinstaller build. Any help would be appreciated!
I tried doing just a pyinstaller --onefile -w "file.py" and I also tried the same file.py using auto-py-to-exe... both ended in the same result.
I had the same problem and fixed it by compiling with the "--hidden-import" option given to pyinstaller. Here is an example...
yinstaller.exe -F -n "Program name" --hidden-import=pyarrow.vendored.version program.py
Hope this helps!

The application has failed to start because its side-by-side configuration is incorrect (Python/ Pyinstaller/ Tkinter)

I programmed a small application and compiled it using pyinstaller. However I can't run my compiled .exe. It shows this error:
Does anyone know how to fix it and create a working .exe?
pyinstaller --noconfirm --onedir --windowed --icon " "
I had the exact same problem. For me it turned out to be a bug related to pyinstaller 4.7 and python 3.9.8. I uninstalled python 3.9.8 and installed 3.9.5 instead and it worked perfectly with pyinstaller -w, my exe file runs without a console window now, and without any errors.
This happens because of --windowed argument in Windows. Without it it compiles and works ok, but you need to keep the Command Prompt window open too. Still trying to find a work-around.

Trying to make an .exe with pyinstaller, am I doing this correctly?

I need to make a script.py to be an executable file.
I researched around for a little bit and found that in order to do that on a 3.5 python script I had to install pyinstaller and type a line like this into the command prompt:
pyinstaller --onefile guiFileOpener_1_1.pyw
But when I did this, I got this error message:
failed to create process
I am not sure what I am doing wrong here...

Python to EXE file in one file

So far I have used cx_freeze to convert .py file to .exe file, but I get many files. Is there a way to get it all into one executable?
I have seen that PyInstallerGUI is able to that, but it is for Python 2.7. Can it be done with Python 3.4 as well?
PyInstaller works up to Python 3.5. Once you've installed it (type in your terminal pip install pyinstaller), you can do in your terminal:
pyinstaller --onefile script.py
where script.py is the name of script you want to compile into .exe
With the --onefile option it will create only one .exe file.
I haven't tried it but, PyInstaller says here it can do that and it supports Python 2.7 and Python 3.3+.
Quoting from the linked page:
PyInstaller can bundle your script and all its dependencies into a
single executable named myscript (myscript.exe in Windows).
The advantage is that your users get something they understand, a
single executable to launch. A disadvantage is that any related files
such as a README must be distributed separately. Also, the single
executable is a little slower to start up than the one-folder bundle.
Before you attempt to bundle to one file, make sure your app works
correctly when bundled to one folder. It is is much easier to diagnose
problems in one-folder mode.
I found this in the PyInstaller documentation:
pyinstaller --onefile your-python-file.py
To find more: PyInstaller documentation

Packaging a Python script that can be run on a computer that doesn't have Python installed?

I have a Python script (that manipulates files on a shared drive). I would like to turn that script into a file (maybe .exe?) that perhaps can be double-clicked and run on a machine that doesn't have Python installed. Is that possible/easy to do?
You can try py2exe.
Tutorials can be found at http://www.py2exe.org/index.cgi/Tutorial
I use and recommend pyinstaller. If you need only one executable file, you need to install pyinstaller and call executable passing these arguments:
pyinstaller.exe your_script.py --onefile --windowed
This options can be used when you generate the executable file: https://pythonhosted.org/PyInstaller/usage.html#options
To install: http://www.pyinstaller.org/
Documentation: https://pythonhosted.org/PyInstaller/

Categories

Resources