This document provides guidance on setting up a development environment for Python and Django projects. It discusses choosing PostgreSQL as the database, installing Python packages and dependencies using pip, virtualenv and virtualenvwrapper, ensuring the necessary C compilers are installed to build extensions, and options for installing pre-built binaries when a C compiler is not desired. Potential issues around version mismatches, architectures, and security are also addressed.
21. Python
• Anything over 2.7.0 should be enough
• YUM is still based on 2.6... Oops.
• Python 3 is coming…or not
• Having both Python 2 and 3 installed on Windows
can be a nightmare
22. Setuptools and PIP
• https://bitbucket.org/pypa/setuptools/raw/
bootstrap/ez_setup.py
• python ez_setup.py
• Modify PATH environment variable if needed
• easy_install pip
34. Build a C Extension
• Get a C compiler
• Install (or compile) library to bind with
• Install CPython headers
• apt-get install python-dev
• pip install <binding_package>
35. Build a C Extension
• Get THE ONE TRUE C compiler
• Install (or compile) library to bind with
• Install CPython headers
• apt-get install python-dev
• pip install <binding_package>
36. Get a Compiler
• apt-get install build-essential
• OK, I got lazy :p
• Install Xcode and its "console tools"
• Install Visual Studio (Express)
• The "for Windows Desktop" version
• Use the correct prompt
41. If you have VS2012 and Python 2.7, for example
set VS90COMNTOOLS=%VS110COMNTOOLS%
42.
43.
44. I No Want C Compiler!
• Pre-compiled binaries from the package manager
• Pre-compiled binaries from the Web
45. Words of Warning
• Version mismatch
• CPU Architecture mismatch (Windows sucks)
• Security issue
• Why pip doesn't offer binary installing
46. From APT
• apt-get install python-psycopg2
• What does it install?
• http://packages.debian.org
• .deb file is merely an ar archive
• ln -s everything into $ENV/lib/site-packages
48. Miscellaneous
• http://rudix.org has pre-built packages for OS X
• I never used it, to be honest :p
• RPM packages can be converted with rpm2cpio and
then extracted with cpio
• Actually you can use MinGW
• Why?
• If you really know what you're doing