Skip to content

Setting up a Python development environment in Windows

Avi Klaiman edited this page Feb 24, 2018 · 10 revisions
  1. Install Python 2.7.11
    • If Python is already installed and its version is lower than 2.7.11 update to a version >= 2.7.11 OR install setuptools & pip(package manager)
  2. Update the PATH to include a reference to the Python and Python/scripts directories (replace C:\Python27 with your path to Python).
    • Command Line: Run this command with Administrator privileges: SETX /M PATH "%PATH%";C:\Python27;C:\Python27\Scripts. The new path will be available in the next opened terminal.
    • GUI: Control Panel > System Properties > Advanced > Environment Variables > System Variables > Path > Edit > Add ;C:\Python27;C:\Python27\Scripts to the end of the line.
  3. Install [PostgreSQL] (http://www.postgresql.org/download/windows/) ( x86 version! even if you have 64 bit os )
    • Add its bin folder to your path: C:\Program Files (x86)\PostgreSQL\<version>\bin\, for example, for version 9.4 add C:\Program Files (x86)\PostgreSQL\9.4\bin\
  4. Install GitHub for windows to get the code
  5. cd to the anyway directory
  6. Download and install Microsoft Visual C++ Compiler for Python 2.7 (https://www.microsoft.com/en-us/download/details.aspx?id=44266)
  7. Download visual-cpp-build-tools http://landinghub.visualstudio.com/visual-cpp-build-tools
  8. pip install -r requirements.txt -r test_requirements.txt

Currently, the packages pyproj and psycopg2 are failing to install so for both of them, you need to download and install the cp27 win32 version, even if you have a 64 bit Windows version installed. http://www.stickpeople.com/projects/python/win-psycopg/ or here: http://www.lfd.uci.edu/~gohlke/pythonlibs