Skip to content

Instantly share code, notes, and snippets.

@mjzffr
Last active January 29, 2020 02:15
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjzffr/6c2b9b6c22dfb2fdc0dd to your computer and use it in GitHub Desktop.
Save mjzffr/6c2b9b6c22dfb2fdc0dd to your computer and use it in GitHub Desktop.
Python on Windows

#Python 2

  1. Install Python 2.7
  • To use pygame (mentioned below), install the 32-bit (x86, not x86-64) version of Python!
  • Location C:\Python27
  • Add C:\Python27\python.exe and C:\Python27\Scripts to PATH
  • In the Start menu, rename the "IDLE" shortcut to "IDLE Python 2.7"
  1. Install pip for package management (http://pip.readthedocs.org/en/latest/installing.html)
  • Download get-pip.py and run python get-pip.py, where python is the command to run the Python 2.7 interpreter.
  • If this works, C:\Python27\Scripts will contain pip.exe
  1. Install virtualenv for environment management (http://virtualenv.readthedocs.org/en/latest/virtualenv.html#installation)
  • pip install virtualenv where pip refers to C:\Python27\Scripts\pip.exe
  1. Install virtualenvwrapper for Powershell: makes virtualenv usage more convenient (https://pypi.python.org/pypi/virtualenvwrapper-powershell/2.7.1)
  • pip install virtualenvwrapper-powershell
  • Add Import-Module virtualenvwrapper to PowerShell profile for all users
  • See sample PowerShell profile below
  1. Install other useful packages for education:

#Python 3

  1. Install Python 3.2
  • To use pygame (mentioned below), install the 32-bit (x86, not x86-64) version of Python!
  • Location C:\Python32
  • Add C:\Python32\python.exe and C:\Python32\Scripts to PATH
  • In the Start menu, rename the "IDLE" shortcut to "IDLE Python 3.2"
  1. Install pip for package management (http://pip.readthedocs.org/en/latest/installing.html)
  • Download get-pip.py and run python get-pip.py, where python is the command to run the Python 3.2 interpreter.
  • If this works, C:\Python34\Scripts will contain pip.exe
  1. Install other useful packages for education:

PowerShell

Sample Profile

Set-Alias python2 "C:\Python27\python.exe"
Set-Alias python3 "C:\Python32\python.exe"
Set-Alias pip3 "C:\Python32\Scripts\pip.exe"
Import-Module virtualenvwrapper
@riyakapoormod
Copy link

I have tried power shell for python27 but its not installing. Is it because my Windows7 has indentified as not a genuine. Do I need to install operating system again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment