Setting Up Python on a Windows Machine

# Install Python 3.8
choco install python --version=3.8 -y

# Add the bin path into the local system's environmental paths
$env:path += ";C:\Python38"

# Validate installed python version
PS C:\temp> python --version
Python 3.8.0

# Validate paths
PS C:\temp> $env:path
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\OpenSSL\bin;C:\Program Files (x86)\vim\vim80;;C:\Program Files\WindowsPowerShell\Scripts;C:\Users\baloo\AppData\Local\Microsoft\WindowsApps;C:\Python38

# Install vim
choco install vim -y

# Create a file with test contents
PS C:\temp> add-content C:\temp\helloworld.py "print('hello world!')"

# Check file content
PS C:\temp> cat c:\temp\helloworld.py
print('hello world!')

# Test Python against the new file
PS C:\temp> python c:\temp\helloworld.py
hello world!

# DONE!

Leave a Reply

Your email address will not be published. Required fields are marked *