How can I append python to path? I tried put the python root, .exe, libs folder, but nothin work. I just want run .py files at cmd in windows.
Thanks.
In Python, the PATH where the python interpreter has visibility is available from sys.path
>>>import sys >>>print sys.path If you want to new paths to be added that list, just append to it.
>>>sys.path.append('c:/new/path/to/lib') cmd has environment variables, commands that are recognized.
To add the python command to cmd, you have to add the path to the folder in the control panel's environment variables section, which calls the python.exe file in your PC's Python folder.
To do this,
Type: environment variables in the search bar

It varies for where you installed python, but for me it is at:C:\Users\USERNAME\AppData\Local\Programs\Python\Python36-32
To find the python.exe file
The AppData folder might be invisible. If the case, the following website is a good reference on making invisible folders visible https://www.howtogeek.com/howto/windows-vista/show-hidden-files-and-folders-in-windows-vista/
For the pip command, the same steps apply, only that the pip.exe file is in the \Scripts folder.
python path/to/file.py