When starting my current job, I was new to Linux, Python, Django, MySQL, and pretty much every other technology the organization uses. Furthermore, as the office’s only Windows 7 person, I was on my own when setting up a development environment.
I found several helpful tutorials but ended up creating more detailed instructions to reflect my level of experience and our project structure. These notes became my dummies guide to setting up Python, Django, and MySQL on Windows 7.
- Part 1: installing Python, pip, and iPython (you are here)
- Part 2: virtual environments
- Part 3: making iPython work in virtual environments
- Part 4: installing Django
- Part 5: installing MySQL
Install Python
- Install Python (I used the Python 2.7.2 Windows Installer).
- Modify your path environment variable to include the location of the installed Python executable. To change environment variables in Windows 7:
- Click the Windows start button in the lower-left corner of the screen.
- In the Search programs and files box, type environment variables
- When the search results appear, click Edit the system environment variables

- You should now see the System Properties window. Click Environment Variables…

- When the Environment Variables window opens, choose Path from the System variables list and click Edit…
- Append the following location of the Python executable and the Python Scripts folder to the variable value, making sure everything is separated by a semicolon. For example,
;C:\Python27;C:\Python27\Scripts - Click OK after modifying the variable value, and click OK again to exit the Environment Variables dialog.
- You should now be able to bring up an interactive Python shell by opening a command window and typing
python.

Get a package installation and management tool
Many kind people have written functionality-enhancing Python Packages, and sooner rather than later you’ll need to use some of them. Life will be much easier if you have a tool to install and manage these packages.
Two such tools are pip and easy_install (part of setuptools). Despite some disadvantages on Windows, I chose pip after reading this StackOverflow thread.
Unfortunately, pip doesn’t have a Windows installer. The easiest workaround is to install setuptools (which does have a Windows installer) and then use it to install pip. Directions below are a modified version of yet another StackOverflow thread.
- Download the setuptools MS Windows installer that corresponds to your installed version of Python.
- Run the setuptools install wizard. It should automatically find your Python installation directory. Unless you’re on a 64-bit version of Windows 7, in which case you’ll need to follow these directions to make sure the setuptools installer can find Python.

- Make sure you have a way to extract .tar files (e.g., 7-Zip).
- Download pip.
- Uncompress the pip download
- Open a Windows command prompt and
cdto the directory that contains the uncompressed pip download (the folder structure looks something like pip-1.1). Make sure it’s the directory that contains a file called setup.py. - From that directory, type
python setup.py install - After this script runs, you should see a confirmation message that pip was installed to the site-packages folder of your python install (this folder will house all of the Python packages you install).

- If you get an error message, it’s probably because you haven’t added your Python directory to your path (see I above).
Install iPython
You don’t know it yet, but you need iPython. It’s a richer version Python’s out-of-the-box interactive shell and has some extremely helpful features for people learning the language (object introspection, macros, code completion). iPython is easy to install now that you have a package management tool.
Even though I just had you install pip for this very scenario, it’s not the best choice for installing iPython on Windows. I promise pip will come in handy later, but to install iPython, use setuptools (setuptools will automatically install a module required for iPython’s code completion functionality, but pip will not).
- Open a windows command prompt.
- Type
easy_install ipython - iPython should now download and install. If you get an error message, make sure your path environment variable contains the Python \Scripts folder.

- To use the iPython interactive shell, type
ipythonfrom a command window and peruse the built-in documentation.
The next part of Python, Django, & MySQL on Windows 7 will walk you through virtual environments.

Great tutorial!! Thanks.
when I type this command easy_install ipython in the command shell it shows me the following log error. I am using a proxy server. Can someone help me regarding this:
C:\>easy_install ipython
Searching for ipython
Reading http://pypi.python.org/simple/ipython/
No local packages or download links found for ipython
Best match: None
Traceback (most recent call last):
File “c:\Python27\Scripts\easy_install-script.py”, line 8, in
load_entry_point(‘setuptools==0.6c11′, ‘console_scripts’, ‘easy_install’)()
File “c:\Python27\lib\site-packages\setuptools\command\easy_install.py”, line
1712, in main
with_ei_usage(lambda:
File “c:\Python27\lib\site-packages\setuptools\command\easy_install.py”, line
1700, in with_ei_usage
return f()
File “c:\Python27\lib\site-packages\setuptools\command\easy_install.py”, line
1716, in
distclass=DistributionWithoutHelpCommands, **kw
File “c:\Python27\lib\distutils\core.py”, line 152, in setup
dist.run_commands()
File “c:\Python27\lib\distutils\dist.py”, line 953, in run_commands
self.run_command(cmd)
File “c:\Python27\lib\distutils\dist.py”, line 972, in run_command
cmd_obj.run()
File “c:\Python27\lib\site-packages\setuptools\command\easy_install.py”, line
211, in run
self.easy_install(spec, not self.no_deps)
File “c:\Python27\lib\site-packages\setuptools\command\easy_install.py”, line
434, in easy_install
self.local_index
File “c:\Python27\lib\site-packages\setuptools\package_index.py”, line 475, in
fetch_distribution
return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: ‘NoneType’ object has no attribute ‘clone’