"Python" Not Recognized as a Command

python' is not recognized as an internal or external command

You need to add that folder to your Windows Path:

https://docs.python.org/2/using/windows.html Taken from this question.

Python command not working in command prompt

It finally worked!!!

I needed to do things to get it to work

  1. Add C:\Python27\ to the end of the PATH system variable
  2. Add C:\Python27\ to the end of the PYTHONPATH system variable

I had to add these to both for it to work.

If I added any subdirectories, it did not work for some reason.

Thank you all for your responses.

Not recognized as an internal or external command, operable program or batch file

The executable, if it was created, is not in your path. You can try:

python -m hikvision-recover <serial number> <Date information>

How to make Python not recognized as an internal or external command an exception

It appears you are using Python to run a Python file using the operating system shell.
You can run the file by importing it and (if needed) instantiating it.

try:
# import the python file
import currency.py
# instantiate the class/function if required
except ImportError:
ctypes.windll.user32.MessageBoxW(0, u"Error", u"Error", 0)

Nevertheless you can avoid using the try/catch scenario by seeing if the file exists, if not, display your error message:

if os.path.isfile(file_path):
os.system('currency.py')
else:
ctypes.windll.user32.MessageBoxW(0, u"Error", u"Error", 0)


Related Topics



Leave a reply



Submit