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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

ragini dahihande

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.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Hartmut Goebel
Am 18.01.2017 um 11:04 schrieb ragini dahihande:

From that file I am calling another python script.



You can not run an external Python script, as PyInstaller does not provide a python executable. You have some options to work around this: a) make an executable out of the other script, too, b) install Python on the target machine (in which case PyInstaller would be some kind of superfluous), or c) fork your program and run the other script in the forked process.

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/deshalb-tr-069-ausschalten
Kolumne: http://www.cissp-gefluester.de/2012-01-in-die-cloud-in-die-cloud-aber-wo-soll-die-sein

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Coyot Linden (Glenn Glazer)
On 1/18/17 02:31, Hartmut Goebel wrote:
Am 18.01.2017 um 11:04 schrieb ragini dahihande:

From that file I am calling another python script.



You can not run an external Python script, as PyInstaller does not provide a python executable. You have some options to work around this: a) make an executable out of the other script, too, b) install Python on the target machine (in which case PyInstaller would be some kind of superfluous), or c) fork your program and run the other script in the forked process.

Another option, depending on how the other script is written, is import the other script as a module and run the functionality from the first script.  This will work better if the script to be imported has its functionality broken down into methods.  Once the second script is imported, then from the runtime's perspective, it is no different than import time.

Best,

coyot

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.