Download and install Python using the interactive EXE installer and make sure to include the path. Make sure to check the py launcher
and pip
checkboxes as well.
Once it's finished installing open a new command prompt window and verify Python 3 installed properly with the following command:
py -V
It should return something like: Python 3.8.x
.
setx PATH "%PATH%;C:\Python38"
setx PATH "%PATH%;C:\Python38\Scripts"
py -m pip install --upgrade pip
If you get a permissions error then use the --user
flag while installing:
py -m pip install --upgrade pip --user
The python3
and pip3
wrappers for the respective Python3 and PIP3 commands are now deprecated in Windows 10—use py
and py -m pip
instead.
Use the py
command to enter into the interactive interpreter for Python 3 (Press CTRL+Z and then Return to exit the interface).
Use the following command to get your current version of PIP:
py -m pip -V
It should return something like: pip 20.0.2 from C:\Path\To\AppData\Roaming\Python\Python38\site-packages\pip (python 3.8)
The following example command will install PyGame using PIP3 for Python 3.8 in Window 10
py -m pip install pygame --user
To execute a Python script just use py
followed by the script's path and file name:
py hello_world.py
You'll have to use py -m
with the Python venv
command as well. The following example command will create a new virtual environemnt for you call new-venv
:
py -m venv new-venv
Once it's finished you can input dir
, and you should see the new-venv
directory. Enter into the directory with the following:
cd new-venv
Now go inside the Scripts
directory and execute the activate.bat
file to enter inside the virtual environment:
activate.bat
If you input exit
it will stop the venv interface, but it will also close the command prompt window as well. Use the deactivate
command to exit the venv without closing the command terminal.