-
Notifications
You must be signed in to change notification settings - Fork 3
Installing Python and pip
This is mostly a copy of the wiki page of from BurntSushi's nfldb repository wiki page.
Installation of Python itself should be fairly straight-forward.
- Download and execute the latest Python 2.* installation package from here.
- Make sure to choose to install Pip among other things and also to select the option to add Python to PATH, i.e. make it executable from any directory.
- Verify a successful installation by opening a command prompt window (type
cmd
in the Windows start bar) and navigating to your Python installation directory (default isC:\Python27
). Typepython
from this location to launch the Python interpreter.Microsoft Windows [Version 6.2.9200] (c) 2012 Microsoft Corporation. All rights reserved. C:\Users\Username>cd C:\Python27 C:\Python27>python Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>>
If you forgot to select making Python executable during installation, you will (probably) have to do the following:
- It would be nice to be able to run Python from any location without having to constantly reference the full installation path name. This can by done by adding the Python installation path to Windows'
PATH
ENVIRONMENT VARIABLE
*In Windows 7 and Windows 8, simply searching for "environment variables" will present the option toEdit the system environment variables
. This will open theSystem Properties / Advanced
tab - BE CAREFUL WHEN EDITING ENVIRONMENT VARIABLES!
In Windows XP, right click on My Computer->Properties
to open System Properties
and click on the Advanced
tab.
- On the
System Properties / Advanced
tab, clickEnvironment Variables
to openUser Variables
andSystem Variables
- Create a new
System Variable
named Variable name:PYTHON_HOME
and Variable value:c:\Python27
(or whatever your installation path was)
- Find the system variable called
Path
and clickEdit
- Add the following text to the end of the Variable value:
;%PYTHON_HOME%\;%PYTHON_HOME%\Scripts\
- Verify a successful environment variable update by opening a new command prompt window (important!) and typing
python
from any locationMicrosoft Windows [Version 6.2.9200] (c) 2012 Microsoft Corporation. All rights reserved. C:\Users\Username>python Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>>
The easiest way to install Python packages and keep them up-to-date is with a Python-based package manager called pip
You should already have pip installed from the Python installation. Otherwise you will have to download it, install adn probably add to PATH as well.
After installing pip you can open the command prompt and do:
Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.
C:\Users\Username>pip install numpy scipy matplotlib jupyter
to install the basic packages (NumPy, SciPy, Matplotlib -- for plots, Jupyter -- for notebooks)