'python' is not recognized as an internal or external command, operable program or batch file - pyinstaller

I have created exe of python file using pyinstaller.From that file I am calling another python script.when I run my project on clean VM where python is not installed I am getting error like python is not recognised
import subprocess
import time
import sys
import os
print ("Hello")
python_path = "python"
args = [python_path,'test.py']
print(args)
subprocess.Popen(args)
time.sleep(100)
Where pyinstaller will look for python.When exe is frozen I found only python35.dll.How can i run python script from exe without installing python.

Download a standalone python package like WinPython-64bit-2.7.10.3 (This does not require to be installed with admin rights). You can unzip the files to a preferred directory.
From the WinPython-64bit-2.7.10.3 folder, you can copy the contents of the python source code folder (Eg : python-2.7.10.amd64, in this case) to the directory where you have placed exe file created using pyinstaller.
The python-2.7.10.amd64 (In this case) has the python.exe and other dependency files required for the subprocess call to run.

Related

'cfgrib' is not showing in xarray engine list, when the python code is packaged with pyinstaller to get exe file

I am trying to create an executable file from python code with 'Pyinstaller' package. The code runs in conda environment where the cfgrib selfcheck is good:
Found: eccodes v2.27.0.
your system is ready
However when the executable created by pyinstaller runs, the error is:
ValueError: unrecognized engine cfgrib must be one of: ['scipy','store']
I adde 'eccodes', 'python-eccodes', 'cfgrib', 'netcdf4' to the hidden imports, but no success. Does anybody have any idea to fix this issue!

Module not installed

I am writing a Dataframe to a Parquet file with Dask using the following code:
df.to_parquet('Filepath', engine='pyarrow')
Pyarrow module is required to run this code and it runs fine on my editor.
But when I package the code using Pyinstaller and try to run the .exe file I get the error
'pyarrow' not installed
How to fix this?
Note - I'm using the same python environment for Pyinstaller as well as my editor.

PyInstaller EXE not executing

I have created an executable file from .py using PyInstaller. My python file contains the packages PySAM, pandas and os. Although the executable has been created successfully, while running it aborts before/while importing the packages and closes. I believe this is due to the PySAM package. I am looking for a solution such that the executable runs the entire code
Thanks in advance!

How do I fix "pyinstaller is not found as a command" error?

I am trying to convert main.py into an executable. I have the pyinstaller files in this directory as well as main.py but it returns this error code
(journal) C:\Users\caleb\PycharmProjects\PythonProjects\journal>pyinstaller main.py
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.
Me to.My error:
'pyinstaller' is not recognized as an internal or external command,
operable program or batch file.
Then I uninstall Python then I download Python and click "Add python to path"
enter image description here
And it is work very good!
I can run pyinstaller and more!

This utility is primary meant to be used when PyInstaller is not installed

I have python3.4 installed on a Windows7 machine.
I just installed PyInstaller on that machine using pip.
Then executed "pyinstaller.py test.py" from C:\Python34 folder in console which
(i) is not showing any error in console
(ii) is opening a text file which ends with
"# This utility is primary meant to be used when PyInstaller is not
# installed, eg. when be run by a git checkout.
from PyInstaller.main import run
run()
"
(iii) is not creating any test.exe anywhere.
How to execute PyInstaller to create a executable ?

Resources