SaltyCrane: install_setuphttps://www.saltycrane.com/blog/2012-10-24T10:44:56-07:00How to use pip with crate.io
2012-10-24T10:44:56-07:00https://www.saltycrane.com/blog/2012/10/how-use-pip-crateio/Here's how to use pip with <a href="https://crate.io">crate.io</a> (in case <a href="http://pypi.python.org/">pypi.python.org</a> goes down):
<pre class="console">$ pip install --index-url=https://simple.crate.io yolk </pre>
Or with logging to see what's happening:
<pre class="console">$ pip install --log=my-pip-debug.log --index-url=https://simple.crate.io yolk </pre>
<h4 id="see-also">See also</h4>
<ul>
<li><a href="http://jacobian.org/writing/when-pypi-goes-down/">
http://jacobian.org/writing/when-pypi-goes-down/</a></li>
<li><a href="https://github.com/crateio/crate.io">
https://github.com/crateio/crate.io</a></li>
<li><a href="http://aboutsimon.com/2012/02/24/create-a-local-pypi-mirror/">
http://aboutsimon.com/2012/02/24/create-a-local-pypi-mirror/</a></li>
<li><a href="http://www.python.org/dev/peps/pep-0381/">
http://www.python.org/dev/peps/pep-0381/</a></li>
<li><a href="http://www.pypi-mirrors.org/">
http://www.pypi-mirrors.org/</a></li>
</ul>
How to install MySQLdb in a virtualenv on Ubuntu Karmic
2010-02-15T12:07:08-08:00https://www.saltycrane.com/blog/2010/02/install-mysqldb-virtualenv-ubuntu-karmic/<ul>
<li>Install dependencies
<pre>sudo apt-get build-dep python-mysqldb</pre>
</li>
<li>Install MySQLdb with pip/virtualenv
<pre>cd ~/lib/python-environments
virtualenv --distribute --no-site-packages default
pip install -E default/ MySQL-python</pre>
</li>
</ul>
<h4>EnvironmentError: mysql_config not found</h4>
<p>The first time, I did not install the dependencies and got the following error:</p>
<pre>$ pip install -E default/ http://sourceforge.net/projects/mysql-python/files/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz/download
Downloading/unpacking http://sourceforge.net/projects/mysql-python/files/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz/download
Downloading download (89Kb): 89Kb downloaded
Running setup.py egg_info for package from http://sourceforge.net/projects/mysql-python/files/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz/download
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/tmp/pip-ZR_ZwM-build/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/tmp/pip-ZR_ZwM-build/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in ./pip-log.txt</pre>
How to install pip on Ubuntu
2010-02-15T11:42:52-08:00https://www.saltycrane.com/blog/2010/02/how-install-pip-ubuntu/<p>
<a href="http://pypi.python.org/pypi/pip">Pip</a> is a better alternative to
<a href="http://pypi.python.org/pypi/setuptools">Easy Install</a> for installing Python packages.
It is most "nutritious" when used with its companion
<a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a>.
For more information on pip and virtualenv see my blog post:
<em><a href="http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/">
Notes on using pip and virtualenv with Django</a></em>.
</p>
<h4>Install pip and virtualenv for Ubuntu 10.10 Maverick and newer</h4>
<pre class="console">$ sudo apt-get install python-pip python-dev build-essential
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv </pre>
<h4>For older versions of Ubuntu</h4>
<ul>
<li>Install Easy Install
<pre class="console">$ sudo apt-get install python-setuptools python-dev build-essential </pre>
</li>
<li>Install pip
<pre class="console">$ sudo easy_install pip </pre>
</li>
<li>Install virtualenv
<pre class="console">$ sudo pip install --upgrade virtualenv </pre>
</li>
</ul>
Using psycopg2 with virtualenv on Ubuntu <del>Jaunty</del>Maverick
2009-07-31T22:56:10-07:00https://www.saltycrane.com/blog/2009/07/using-psycopg2-virtualenv-ubuntu-jaunty/<p><em>Update 2009-11-02</em>: Well I am dumb-- psycopg2 can be installed with
pip/easy_install. The reason I got the error before was because I didn't have
the required dependencies installed. On Ubuntu, I used <code>apt-get build-dep</code>.
So, here's the summary:</p>
<p><em>Update 2009-11-11</em>: My update doesn't work. See comments
<a href="#c5746">#4</a> and <a href="#c5750">#5</a> below.</p>
<p><em>Update 2010-05-17</em>: Here is what finally worked for me using
Python 2.6 on Ubuntu 10.04 Lucid Lynx using virtualenv 1.4.8 and pip 0.7.1. Thanks to <a href="#c9520">Daniel</a>
for the final piece of the solution.
</p>
<p><em>Update 2011-05-13</em>: Looks like the mx+virtualenv issue has been
<a href="http://is.gd/JcwElp">reported</a> and
<a href="https://github.com/dvarrazzo/psycopg/commit/af424821b70299704449337904d3ab7fb1b40751">fixed</a> to be released in 2.4.2.
via <a href="http://twitter.com/#!/psycopg/status/68992875530162176">@psycopg's tweet</a>
</p>
<p><em>Update 2011-11-05</em>: psycopg2 2.4.2 has been released with the mxDateTime fix
so the install is very easy now.</p>
<h4>Install dependencies</h4>
<pre class="console">$ sudo apt-get build-dep python-psycopg2</pre>
<h4>Install pyscopg2 in a virtualenv</h4>
<pre class="console">$ virtualenv --no-site-packages myenv
$ source myenv/bin/activate
$ pip install psycopg2 </pre>
<br>
<p>No longer needed:
<del>$ easy_install -i http://downloads.egenix.com/python/index/ucs4/ egenix-mx-base </del>
</p>
<br><br>
<p><b>*** THE REST OF THIS POST DESCRIBES MY INITIAL OUTDATED SOLUTION. ***</b></p>
<p>I <a href="/blog/2009/05/notes-using-pip-and-virtualenv-django/">
recently</a> starting using <a href="http://pypi.python.org/pypi/virtualenv">
virtualenv</a> for creating isolated Python environments. Virtualenv has made
it easy to manage different Python configurations for different websites, but I
was slowed down a bit trying to use <a href="http://pypi.python.org/pypi/psycopg2/">
psycopg2</a>, the Python-PostgreSQL database adapter, with virtualenv after upgrading
to Ubuntu 9.04 Jaunty Jackalope.
</p>
<p>
Currently, virtualenv (1.3.3) doesn't find Ubuntu Jaunty's Python packages.
In Ubuntu Jaunty, the default Python version changed from 2.5 to 2.6. More importantly,
the <code>site-packages</code> directory was changed to <code>dist-packages</code>.
Prior to Ubuntu 9.04, Ubuntu's Python packages, such as <code>python-psycopg2</code>,
were installed to <code>/usr/lib/python2.5/site-packages</code>. Now Ubuntu's Python
packages are installed to <code>/usr/lib/python2.6/dist-packages</code>. (See
<a href="http://groups.google.com/group/python-virtualenv/browse_thread/thread/79c685d103c805c7">
this discussion</a> at the virtualenv group for more information.)
</p>
<p>As a result of this change, virtualenv (as of 1.3.3) doesn't find Ubuntu's
Python packages installed using <code>apt-get</code>. My solution
was to create symlinks to the desired packages and egg-info files in
<code>site-packages</code>. I'm not sure if this is the proper way to handle this.
If there is a better solution, please let me know. One advantage of using this
method is that I don't need to clutter my virtualenv with all the packages that
have accumulated in my global <code><del>site-packages</del>dist-packages</code>.
</p>
<h4>Install easy_install, pip, and virtualenv</h4>
<pre>sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install -U pip
sudo pip install -U virtualenv</pre>
<h4>Install Ubuntu's psycopg2 package</h4>
<pre>sudo apt-get install python-psycopg2</pre>
<h4>Symlink the psycopg2 (and mxDateTime) files</h4>
<pre>sudo mkdir /usr/lib/python2.6/site-packages
sudo ln -s /usr/lib/python2.6/dist-packages/psycopg2 /usr/lib/python2.6/site-packages
sudo ln -s /usr/lib/python2.6/dist-packages/psycopg2-2.0.8.egg-info /usr/lib/python2.6/site-packages
sudo ln -s /usr/lib/python2.6/dist-packages/mx /usr/lib/python2.6/site-packages</pre>
<h4>Create a virtualenv</h4>
<pre>virtualenv myenv</pre>
<h4>Check what's available</h4>
<pre>pip freeze -E myenv</pre>
<p>Results:</p>
<pre>psycopg2==2.0.8
wsgiref==0.1.2</pre>
<br><br>
<p>Note: you might wonder why I didn't do a <code>pip install -E myenv psycopg2</code>.
I tried this, but got an error. Maybe psycopg2 doesn't support pip/easy_install?
Here is my error message:</p>
<pre style="overflow: scroll; height: 70px">Downloading/unpacking psycopg2
Downloading psycopg2-2.0.11.tar.gz (255Kb): 255Kb downloaded
Running setup.py egg_info for package psycopg2
error: No such file or directory
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
error: No such file or directory
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in ./pip-log.txt
Complete output from command temp/bin/python /usr/local/lib/python2.6/dist-packages/pip-0.4-py2.6.egg/pip.py install -E temp psycopg2 temp ___VENV_RESTART___:
----------------------------------------
Traceback (most recent call last):
File "/usr/local/bin/pip", line 3, in <module>
pip.main()
File "/usr/local/lib/python2.6/dist-packages/pip-0.4-py2.6.egg/pip.py", line 926, in main
return command.main(initial_args, args[1:], options)
File "/usr/local/lib/python2.6/dist-packages/pip-0.4-py2.6.egg/pip.py", line 258, in main
restart_in_venv(options.venv, site_packages, complete_args)
File "/usr/local/lib/python2.6/dist-packages/pip-0.4-py2.6.egg/pip.py", line 1009, in restart_in_venv
call_subprocess([python, file] + args + [base, '___VENV_RESTART___'])
File "/usr/local/lib/python2.6/dist-packages/pip-0.4-py2.6.egg/pip.py", line 3643, in call_subprocess
% (command_desc, proc.returncode))
pip.InstallationError: Command temp/bin/python /usr/local/lib/python2.6/dist-packages/pip-0.4-py2.6.egg/pip.py install -E temp psycopg2 temp ___VENV_RESTART___ failed with error code 1</pre>
Notes on using pip and virtualenv with Django
2009-05-06T23:18:37-07:00https://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/<p>I have been using
<a href="/blog/2008/08/somewhere-your-python-path/">
a symlinking method</a> to install Python packages up to this point. To better
handle dependencies and multiple versions I have wanted to switch over to
<a href="http://pypi.python.org/pypi/pip">pip</a> and
<a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a>.
Pip is a better alternative to
<a href="http://peak.telecommunity.com/DevCenter/EasyInstall">Easy Install</a>
and virtualenv is a tool to create isolated Python environments.
I have wanted to use pip and virtualenv for a long time now. Finally, today,
I took my first steps and created an environment with the Python packages
required for this blog. My notes are below. (I am running Ubuntu
<del>Intrepid</del><del>Karmic</del>Maverick and Python <del>2.5</del>2.6.)
A lot of my notes on virtualenv are taken from
<a href="http://arthurkoziel.com/2008/10/22/working-virtualenv/">
Arthur Koziel's excellent tutorial</a>.
</p>
<p><em>Update 2012-03-14:</em> Updated examples for pip 1.1 and virtualenv 1.7. As of pip 1.1,
the <code>-E</code> option is removed. As of virtualenv 1.7, the <code>--no-site-packages</code>
has become the default and is deprecated. Use <code>--system-site-packages</code> if you
want to include system site packages (the old default behavior). Examples are run on Ubuntu
10.10 Maverick Meerkat.
</p>
<h4 id="install-easy-install">Install Easy Install</h4>
<p>If you don't already have Easy Install, it can be installed as follows:</p>
<pre class="console">$ sudo apt-get install python-setuptools python-dev build-essential</pre>
<h4 id="install-pip">Install pip</h4>
<p>In most cases it is not necessary to install pip because it is included with virtualenv.</p>
<pre class="console">$ sudo easy_install -U pip
install_dir /usr/local/lib/python2.6/dist-packages/
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://pip.openplans.org
Reading http://www.pip-installer.org
Best match: pip 1.1
Downloading http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz#md5=62a9f08dd5dc69d76734568a6c040508
Processing pip-1.1.tar.gz
Running pip-1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-i_5nEU/pip-1.1/egg-dist-tmp-ytHsCZ
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip-2.6 script to /usr/local/bin
Installed /usr/local/lib/python2.6/dist-packages/pip-1.1-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip</pre>
<h4 id="install-virtualenv">Install virtualenv</h4>
<pre class="console">$ sudo easy_install -U virtualenv
install_dir /usr/local/lib/python2.6/dist-packages/
Searching for virtualenv
Reading http://pypi.python.org/simple/virtualenv/
Reading http://www.virtualenv.org
Reading http://virtualenv.openplans.org
Best match: virtualenv 1.7.1.2
Downloading http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.7.1.2.tar.gz#md5=3be8a014c27340f48b56465f9109d9fa
Processing virtualenv-1.7.1.2.tar.gz
Running virtualenv-1.7.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-td3AoM/virtualenv-1.7.1.2/egg-dist-tmp-7dJVfO
warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
Adding virtualenv 1.7.1.2 to easy-install.pth file
Installing virtualenv script to /usr/local/bin
Installed /usr/local/lib/python2.6/dist-packages/virtualenv-1.7.1.2-py2.6.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv</pre>
<h4 id="create-virtualenv">Create a virtual environment</h4>
<p>This command creates the isolated virtual environment.</p>
<p><em>Update 2010-04-13:</em> Updated to use
<a href="http://pypi.python.org/pypi/distribute">distribute</a> because
it is the <a href="http://s3.pixane.com/pip_distribute.png">new hotness</a>.
</p>
<pre class="console">$ cd /tmp</pre>
<pre class="console">$ virtualenv --distribute myenv
New python executable in myenv/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.</pre>
<h4 id="create-virtualenv-with-a-different-version-of-python">Create a virtualenv with a different version of Python</h4>
<p>This creates a virtualenv that uses Python 2.7 instead of the default Python 2.6.</p>
<pre class="console">$ virtualenv --distribute --python=/usr/bin/python2.7 myenv-py27
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in myenv-py27/bin/python2.7
Also creating executable in myenv-py27/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.</pre>
<h4 style="color:#888888" id="clear-pythonpath">Clear the PYTHONPATH variable</h4>
<p style="color:#888888">I don't know if this is necessary, but I had a problem with the akismet
module when this was set. Maybe I did something wrong, but when I cleared
PYTHONPATH, it worked.
</p>
<pre style="color:#888888">$ export PYTHONPATH=</pre>
<h4 id="install-yolk">Install a package (Yolk) in the new virtual environment</h4>
<p>Activate the virtual environment and install Yolk inside it.
(<a href="http://pypi.python.org/pypi/yolk">Yolk</a> is a tool that
lists Python packages.)
</p>
<pre class="console">$ source /tmp/myenv/bin/activate
$ pip install yolk
Downloading/unpacking yolk
Downloading yolk-0.4.3.tar.gz (86Kb): 86Kb downloaded
Running setup.py egg_info for package yolk
warning: no files found matching '*.txt' under directory 'tests'
warning: no files found matching '*.conf' under directory 'docs'
warning: no files found matching '*.css_t' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
warning: no files found matching 'tests/test_cli.py'
Requirement already satisfied (use --upgrade to upgrade): distribute in ./myenv/lib/python2.6/site-packages/distribute-0.6.24-py2.6.egg (from yolk)
Installing collected packages: yolk
Running setup.py install for yolk
warning: no files found matching '*.txt' under directory 'tests'
warning: no files found matching '*.conf' under directory 'docs'
warning: no files found matching '*.css_t' under directory 'docs'
warning: no files found matching 'indexsidebar.html' under directory 'docs'
warning: no files found matching 'tests/test_cli.py'
Installing yolk script to /tmp/myenv/bin
Successfully installed yolk
Cleaning up...</pre>
<h4 id="activate-virtualenv">Use the virtual environment</h4>
<ul>
<li>Activate the virtual environment
<pre class="console">$ source /tmp/myenv/bin/activate</pre>
</li>
<li>Run yolk to list your installed packages:
<pre class="console">$ yolk -l
Python - 2.6.6 - active development (/usr/lib/python2.6/lib-dynload)
distribute - 0.6.24 - active
pip - 1.1 - active
wsgiref - 0.1.2 - active development (/usr/lib/python2.6)
yolk - 0.4.3 - active</pre>
</li>
<li>Deactivate the environment
<pre class="console">$ deactivate</pre>
</li>
<li>Try running yolk
<pre class="console">$ yolk -l
yolk: command not found</pre>
</li>
</ul>
<h4 id="install-django">Install Django in the virtual environment</h4>
<pre class="console">$ source /tmp/myenv/bin/activate
$ pip install Django
Downloading/unpacking Django
Downloading Django-1.3.1.tar.gz (6.5Mb): 6.5Mb downloaded
Running setup.py egg_info for package Django
Installing collected packages: Django
Running setup.py install for Django
changing mode of build/scripts-2.6/django-admin.py from 644 to 755
changing mode of /tmp/myenv/bin/django-admin.py to 755
Successfully installed Django
Cleaning up...</pre>
<h4 id="pip-freeze">Create a requirements file from existing library versions using pip freeze</h4>
<br>
<p>The <code>pip freeze</code> command allows you to take a snapshot of the
exact versions of all your Python libraries. For more information,
see the documentation on
<a href="http://www.pip-installer.org/en/latest/requirements.html#freezing-requirements">pip freeze</a>.
</p>
<pre class="console">$ source /tmp/myenv/bin/activate
$ pip freeze > /tmp/requirements.txt</pre>
<pre class="console">$ cat /tmp/requirements.txt
Django==1.3.1
distribute==0.6.24
wsgiref==0.1.2
yolk==0.4.3</pre>
<h4 id="pip-uninstall">Uninstall a package</h4>
<pre class="console">$ source /tmp/myenv/bin/activate
$ pip uninstall Django
Uninstalling Django:
/tmp/myenv/bin/django-admin.py
/tmp/myenv/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg-info
/tmp/myenv/lib/python2.6/site-packages/django
Proceed (y/n)? y
Successfully uninstalled Django</pre>
<span id="requirements"></span>
<h4 id="pip-requirements">Install libraries based on a requirements file</h4>
<p>Once you have a requirements file, you can use pip to install the exact versions
of the libraries specified in your requirements file. For more information,
see the documentation on <a href="http://www.pip-installer.org/en/latest/requirements.html">pip
requirements files</a>.
Here's my requirements file for this blog,
<code>/tmp/saltycrane-requirements.txt</code>:</p>
<pre>psycopg2==2.4.2
Django==1.3.1
Markdown==2.0
http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.0.7a.tar.gz
Pygments==1.3.1
Twisted==10.0.0
http://django-tagging.googlecode.com/files/django-tagging-0.3.1.tar.gz
-e hg+http://bitbucket.org/ubernostrum/django-contact-form/#egg=django-contact-form
-e hg+http://bitbucket.org/jezdez/akismet/#egg=akismet
Fabric==1.3.1</pre>
<p>Here's the command to install using my reqirements file:
</p>
<pre class="console" style="height: 600px; overflow: auto">$ source /tmp/myenv/bin/activate
$ pip install -r /tmp/saltycrane-requirements.txt
Downloading/unpacking http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.0.7a.tar.gz (from -r /tmp/saltycrane-requirements.txt (line 7))
Downloading BeautifulSoup-3.0.7a.tar.gz
Running setup.py egg_info for package from http://www.crummy.com/software/BeautifulSoup/download/3.x/Beaut
ifulSoup-3.0.7a.tar.gz
Downloading/unpacking http://django-tagging.googlecode.com/files/django-tagging-0.3.1.tar.gz (from -r /tmp/saltycrane-requirements.txt (line 11))
Downloading django-tagging-0.3.1.tar.gz
Running setup.py egg_info for package from http://django-tagging.googlecode.com/files/django-tagging-0.3.1.tar.gz
Downloading/unpacking psycopg2==2.4.2 (from -r /tmp/saltycrane-requirements.txt (line 1))
Downloading psycopg2-2.4.2.tar.gz (667Kb): 667Kb downloaded
Running setup.py egg_info for package psycopg2
no previously-included directories found matching 'doc/src/_build'
Downloading/unpacking Django==1.3.1 (from -r /tmp/saltycrane-requirements.txt (line 4))
Downloading Django-1.3.1.tar.gz (6.5Mb): 6.5Mb downloaded
Running setup.py egg_info for package Django
Downloading/unpacking Markdown==2.0 (from -r /tmp/saltycrane-requirements.txt (line 5))
Downloading Markdown-2.0.zip (93Kb): 93Kb downloaded
Running setup.py egg_info for package Markdown
Downloading/unpacking Pygments==1.3.1 (from -r /tmp/saltycrane-requirements.txt (line 8))
Downloading Pygments-1.3.1.tar.gz (1.1Mb): 1.1Mb downloaded
Running setup.py egg_info for package Pygments
Downloading/unpacking Twisted==10.0.0 (from -r /tmp/saltycrane-requirements.txt (line 9))
Downloading Twisted-10.0.0.tar.bz2 (2.6Mb): 2.6Mb downloaded
Running setup.py egg_info for package Twisted
Obtaining django-contact-form from hg+http://bitbucket.org/ubernostrum/django-contact-form/#egg=django-contact-form (from -r /tmp/saltycrane-requirements.txt (line 12))
Cloning hg http://bitbucket.org/ubernostrum/django-contact-form/ to ./myenv/src/django-contact-form
Running setup.py egg_info for package django-contact-form
Obtaining akismet from hg+http://bitbucket.org/jezdez/akismet/#egg=akismet (from -r /tmp/saltycrane-requirements.txt (line 13))
Cloning hg http://bitbucket.org/jezdez/akismet/ to ./myenv/src/akismet
Running setup.py egg_info for package akismet
Downloading/unpacking Fabric==1.3.1 (from -r /tmp/saltycrane-requirements.txt (line 15))
Downloading Fabric-1.3.1.tar.gz (167Kb): 167Kb downloaded
Running setup.py egg_info for package Fabric
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no files found matching 'fabfile.py'
Downloading/unpacking zope.interface (from Twisted==10.0.0->-r /tmp/saltycrane-requirements.txt (line 9))
Downloading zope.interface-3.8.0.tar.gz (111Kb): 111Kb downloaded
Running setup.py egg_info for package zope.interface
Downloading/unpacking ssh>=1.7.8 (from Fabric==1.3.1->-r /tmp/saltycrane-requirements.txt (line 15))
Downloading ssh-1.7.13.tar.gz (790Kb): 790Kb downloaded
Running setup.py egg_info for package ssh
Requirement already satisfied (use --upgrade to upgrade): distribute in ./myenv/lib/python2.6/site-packages/distribute-0.6.24-py2.6.egg (from zope.interface->Twisted==10.0.0->-r /tmp/saltycrane-requirements.txt (line 9))
Downloading/unpacking pycrypto>=2.1,!=2.4 (from ssh>=1.7.8->Fabric==1.3.1->-r /tmp/saltycrane-requirements.txt (line 15))
Downloading pycrypto-2.5.tar.gz (426Kb): 426Kb downloaded
Running setup.py egg_info for package pycrypto
Installing collected packages: psycopg2, Django, Markdown, Pygments, Twisted, django-contact-form, akismet, Fabric, BeautifulSoup, django-tagging, zope.interface, ssh, pycrypto
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/green.c -o build/temp.linux-x86_64-2.6/psycopg/green.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/pqpath.c -o build/temp.linux-x86_64-2.6/psycopg/pqpath.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/utils.c -o build/temp.linux-x86_64-2.6/psycopg/utils.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/bytes_format.c -o build/temp.linux-x86_64-2.6/psycopg/bytes_format.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/connection_int.c -o build/temp.linux-x86_64-2.6/psycopg/connection_int.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/connection_type.c -o build/temp.linux-x86_64-2.6/psycopg/connection_type.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/cursor_int.c -o build/temp.linux-x86_64-2.6/psycopg/cursor_int.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/cursor_type.c -o build/temp.linux-x86_64-2.6/psycopg/cursor_type.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/lobject_int.c -o build/temp.linux-x86_64-2.6/psycopg/lobject_int.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/lobject_type.c -o build/temp.linux-x86_64-2.6/psycopg/lobject_type.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/notify_type.c -o build/temp.linux-x86_64-2.6/psycopg/notify_type.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/xid_type.c -o build/temp.linux-x86_64-2.6/psycopg/xid_type.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_asis.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_binary.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_binary.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_datetime.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_datetime.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_list.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_list.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_pboolean.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_pboolean.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_pdecimal.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_pdecimal.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_pint.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_pint.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_pfloat.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_pfloat.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_qstring.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_qstring.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/microprotocols.c -o build/temp.linux-x86_64-2.6/psycopg/microprotocols.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/microprotocols_proto.c -o build/temp.linux-x86_64-2.6/psycopg/microprotocols_proto.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/typecast.c -o build/temp.linux-x86_64-2.6/psycopg/typecast.o -Wdeclaration-after-statement
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_MXDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2 (dt dec mx pq3 ext)" -DPG_VERSION_HEX=0x08040B -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6/mx -I/usr/include/python2.6 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/adapter_mxdatetime.c -o build/temp.linux-x86_64-2.6/psycopg/adapter_mxdatetime.o -Wdeclaration-after-statement
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/psycopg/psycopgmodule.o build/temp.linux-x86_64-2.6/psycopg/green.o build/temp.linux-x86_64-2.6/psycopg/pqpath.o build/temp.linux-x86_64-2.6/psycopg/utils.o build/temp.linux-x86_64-2.6/psycopg/bytes_format.o build/temp.linux-x86_64-2.6/psycopg/connection_int.o build/temp.linux-x86_64-2.6/psycopg/connection_type.o build/temp.linux-x86_64-2.6/psycopg/cursor_int.o build/temp.linux-x86_64-2.6/psycopg/cursor_type.o build/temp.linux-x86_64-2.6/psycopg/lobject_int.o build/temp.linux-x86_64-2.6/psycopg/lobject_type.o build/temp.linux-x86_64-2.6/psycopg/notify_type.o build/temp.linux-x86_64-2.6/psycopg/xid_type.o build/temp.linux-x86_64-2.6/psycopg/adapter_asis.o build/temp.linux-x86_64-2.6/psycopg/adapter_binary.o build/temp.linux-x86_64-2.6/psycopg/adapter_datetime.o build/temp.linux-x86_64-2.6/psycopg/adapter_list.o build/temp.linux-x86_64-2.6/psycopg/adapter_pboolean.o build/temp.linux-x86_64-2.6/psycopg/adapter_pdecimal.o build/temp.linux-x86_64-2.6/psycopg/adapter_pint.o build/temp.linux-x86_64-2.6/psycopg/adapter_pfloat.o build/temp.linux-x86_64-2.6/psycopg/adapter_qstring.o build/temp.linux-x86_64-2.6/psycopg/microprotocols.o build/temp.linux-x86_64-2.6/psycopg/microprotocols_proto.o build/temp.linux-x86_64-2.6/psycopg/typecast.o build/temp.linux-x86_64-2.6/psycopg/adapter_mxdatetime.o -lpq -o build/lib.linux-x86_64-2.6/psycopg2/_psycopg.so
no previously-included directories found matching 'doc/src/_build'
Running setup.py install for Django
changing mode of build/scripts-2.6/django-admin.py from 644 to 755
changing mode of /tmp/myenv/bin/django-admin.py to 755
Running setup.py install for Markdown
changing mode of build/scripts-2.6/markdown.py from 644 to 755
changing mode of /tmp/myenv/bin/markdown.py to 755
Running setup.py install for Pygments
Installing pygmentize script to /tmp/myenv/bin
Running setup.py install for Twisted
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c conftest.c -o conftest.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c conftest.c -o conftest.o
building 'twisted.runner.portmap' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c twisted/runner/portmap.c -o build/temp.linux-x86_64-2.6/twisted/runner/portmap.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/twisted/runner/portmap.o -o build/lib.linux-x86_64-2.6/twisted/runner/portmap.so
building 'twisted.protocols._c_urlarg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c twisted/protocols/_c_urlarg.c -o build/temp.linux-x86_64-2.6/twisted/protocols/_c_urlarg.o
twisted/protocols/_c_urlarg.c: In function ‘unquote’:
twisted/protocols/_c_urlarg.c:41: warning: ‘tmp’ may be used uninitialized in this function
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/twisted/protocols/_c_urlarg.o -o build/lib.linux-x86_64-2.6/twisted/protocols/_c_urlarg.so
building 'twisted.test.raiser' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c twisted/test/raiser.c -o build/temp.linux-x86_64-2.6/twisted/test/raiser.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/twisted/test/raiser.o -o build/lib.linux-x86_64-2.6/twisted/test/raiser.so
building 'twisted.python._epoll' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c twisted/python/_epoll.c -o build/temp.linux-x86_64-2.6/twisted/python/_epoll.o
twisted/python/_epoll.c: In function ‘__pyx_f_6_epoll_5epoll___dealloc__’:
twisted/python/_epoll.c:168: warning: label ‘__pyx_L1’ defined but not used
twisted/python/_epoll.c: In function ‘__pyx_f_6_epoll_5epoll_wait’:
twisted/python/_epoll.c:432: warning: label ‘__pyx_L7’ defined but not used
twisted/python/_epoll.c:430: warning: label ‘__pyx_L6’ defined but not used
twisted/python/_epoll.c: In function ‘__pyx_tp_new_6_epoll_epoll’:
twisted/python/_epoll.c:508: warning: unused variable ‘p’
twisted/python/_epoll.c: In function ‘__pyx_tp_dealloc_6_epoll_epoll’:
twisted/python/_epoll.c:513: warning: unused variable ‘p’
twisted/python/_epoll.c: In function ‘__pyx_tp_traverse_6_epoll_epoll’:
twisted/python/_epoll.c:528: warning: unused variable ‘p’
twisted/python/_epoll.c:527: warning: unused variable ‘e’
twisted/python/_epoll.c: In function ‘__pyx_tp_clear_6_epoll_epoll’:
twisted/python/_epoll.c:533: warning: unused variable ‘p’
twisted/python/_epoll.c: At top level:
twisted/python/_epoll.c:32: warning: ‘__Pyx_UnpackItem’ declared ‘static’ but never defined
twisted/python/_epoll.c:33: warning: ‘__Pyx_EndUnpack’ declared ‘static’ but never defined
twisted/python/_epoll.c:34: warning: ‘__Pyx_PrintItem’ declared ‘static’ but never defined
twisted/python/_epoll.c:35: warning: ‘__Pyx_PrintNewline’ declared ‘static’ but never defined
twisted/python/_epoll.c:37: warning: ‘__Pyx_ReRaise’ declared ‘static’ but never defined
twisted/python/_epoll.c:38: warning: ‘__Pyx_Import’ declared ‘static’ but never defined
twisted/python/_epoll.c:39: warning: ‘__Pyx_GetExcValue’ declared ‘static’ but never defined
twisted/python/_epoll.c:40: warning: ‘__Pyx_ArgTypeTest’ declared ‘static’ but never defined
twisted/python/_epoll.c:41: warning: ‘__Pyx_TypeTest’ declared ‘static’ but never defined
twisted/python/_epoll.c:42: warning: ‘__Pyx_GetStarArgs’ declared ‘static’ but never defined
twisted/python/_epoll.c:43: warning: ‘__Pyx_WriteUnraisable’ declared ‘static’ but never defined
twisted/python/_epoll.c:45: warning: ‘__Pyx_ImportType’ declared ‘static’ but never defined
twisted/python/_epoll.c:46: warning: ‘__Pyx_SetVtable’ declared ‘static’ but never defined
twisted/python/_epoll.c:47: warning: ‘__Pyx_GetVtable’ declared ‘static’ but never defined
twisted/python/_epoll.c:48: warning: ‘__Pyx_CreateClass’ declared ‘static’ but never defined
twisted/python/_epoll.c:50: warning: ‘__Pyx_InitStrings’ declared ‘static’ but never defined
twisted/python/_epoll.c:51: warning: ‘__Pyx_InitCApi’ declared ‘static’ but never defined
twisted/python/_epoll.c:52: warning: ‘__Pyx_ImportModuleCApi’ declared ‘static’ but never defined
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/twisted/python/_epoll.o -o build/lib.linux-x86_64-2.6/twisted/python/_epoll.so
building 'twisted.python._initgroups' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c twisted/python/_initgroups.c -o build/temp.linux-x86_64-2.6/twisted/python/_initgroups.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/twisted/python/_initgroups.o -o build/lib.linux-x86_64-2.6/twisted/python/_initgroups.so
changing mode of build/scripts-2.6/mktap from 644 to 755
changing mode of build/scripts-2.6/tap2deb from 644 to 755
changing mode of build/scripts-2.6/tap2rpm from 644 to 755
changing mode of build/scripts-2.6/trial from 644 to 755
changing mode of build/scripts-2.6/pyhtmlizer from 644 to 755
changing mode of build/scripts-2.6/tapconvert from 644 to 755
changing mode of build/scripts-2.6/manhole from 644 to 755
changing mode of build/scripts-2.6/twistd from 644 to 755
changing mode of build/scripts-2.6/ckeygen from 644 to 755
changing mode of build/scripts-2.6/cftp from 644 to 755
changing mode of build/scripts-2.6/conch from 644 to 755
changing mode of build/scripts-2.6/tkconch from 644 to 755
changing mode of build/scripts-2.6/mailmail from 644 to 755
changing mode of build/scripts-2.6/lore from 644 to 755
changing mode of /tmp/myenv/bin/mktap to 755
changing mode of /tmp/myenv/bin/ckeygen to 755
changing mode of /tmp/myenv/bin/cftp to 755
changing mode of /tmp/myenv/bin/conch to 755
changing mode of /tmp/myenv/bin/tap2deb to 755
changing mode of /tmp/myenv/bin/tap2rpm to 755
changing mode of /tmp/myenv/bin/lore to 755
changing mode of /tmp/myenv/bin/trial to 755
changing mode of /tmp/myenv/bin/pyhtmlizer to 755
changing mode of /tmp/myenv/bin/tkconch to 755
changing mode of /tmp/myenv/bin/tapconvert to 755
changing mode of /tmp/myenv/bin/manhole to 755
changing mode of /tmp/myenv/bin/twistd to 755
changing mode of /tmp/myenv/bin/mailmail to 755
Running setup.py develop for django-contact-form
Creating /tmp/myenv/lib/python2.6/site-packages/django-contact-form.egg-link (link to .)
Adding django-contact-form 0.3 to easy-install.pth file
Installed /tmp/myenv/src/django-contact-form
Running setup.py develop for akismet
Creating /tmp/myenv/lib/python2.6/site-packages/akismet.egg-link (link to .)
Adding akismet 0.1.5 to easy-install.pth file
Installed /tmp/myenv/src/akismet
Running setup.py install for Fabric
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no files found matching 'fabfile.py'
Installing fab script to /tmp/myenv/bin
Running setup.py install for BeautifulSoup
Running setup.py install for django-tagging
Running setup.py install for zope.interface
building 'zope.interface._zope_interface_coptimizations' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c src/zope/interface/_zope_interface_coptimizations.c -o build/temp.linux-x86_64-2.6/src/zope/interface/_zope_interface_coptimizations.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/zope/interface/_zope_interface_coptimizations.o -o build/lib.linux-x86_64-2.6/zope/interface/_zope_interface_coptimizations.so
Skipping installation of /tmp/myenv/lib/python2.6/site-packages/zope/__init__.py (namespace package)
Installing /tmp/myenv/lib/python2.6/site-packages/zope.interface-3.8.0-py2.6-nspkg.pth
Running setup.py install for ssh
Running setup.py install for pycrypto
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for __gmpz_init in -lgmp... no
checking for __gmpz_init in -lmpir... no
checking whether mpz_powm is declared... no
checking whether mpz_powm_sec is declared... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inttypes.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for size_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memmove... yes
checking for memset... yes
configure: creating ./config.status
config.status: creating src/config.h
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD2.c -o build/temp.linux-x86_64-2.6/src/MD2.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/MD2.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_MD2.so
building 'Crypto.Hash._MD4' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/MD4.c -o build/temp.linux-x86_64-2.6/src/MD4.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/MD4.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_MD4.so
building 'Crypto.Hash._SHA256' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA256.c -o build/temp.linux-x86_64-2.6/src/SHA256.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/SHA256.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA256.so
building 'Crypto.Hash._SHA224' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA224.c -o build/temp.linux-x86_64-2.6/src/SHA224.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/SHA224.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA224.so
building 'Crypto.Hash._SHA384' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA384.c -o build/temp.linux-x86_64-2.6/src/SHA384.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/SHA384.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA384.so
building 'Crypto.Hash._SHA512' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/SHA512.c -o build/temp.linux-x86_64-2.6/src/SHA512.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/SHA512.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_SHA512.so
building 'Crypto.Hash._RIPEMD160' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -DPCT_LITTLE_ENDIAN=1 -Isrc/ -I/usr/include/python2.6 -c src/RIPEMD160.c -o build/temp.linux-x86_64-2.6/src/RIPEMD160.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/RIPEMD160.o -o build/lib.linux-x86_64-2.6/Crypto/Hash/_RIPEMD160.so
building 'Crypto.Cipher.AES' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/AES.c -o build/temp.linux-x86_64-2.6/src/AES.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/AES.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/AES.so
building 'Crypto.Cipher.ARC2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/ARC2.c -o build/temp.linux-x86_64-2.6/src/ARC2.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/ARC2.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/ARC2.so
building 'Crypto.Cipher.Blowfish' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/Blowfish.c -o build/temp.linux-x86_64-2.6/src/Blowfish.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/Blowfish.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/Blowfish.so
building 'Crypto.Cipher.CAST' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/CAST.c -o build/temp.linux-x86_64-2.6/src/CAST.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/CAST.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/CAST.so
building 'Crypto.Cipher.DES' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/include/python2.6 -c src/DES.c -o build/temp.linux-x86_64-2.6/src/DES.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/DES.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/DES.so
building 'Crypto.Cipher.DES3' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/include/python2.6 -c src/DES3.c -o build/temp.linux-x86_64-2.6/src/DES3.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/DES3.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/DES3.so
building 'Crypto.Cipher.ARC4' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/ARC4.c -o build/temp.linux-x86_64-2.6/src/ARC4.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/ARC4.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/ARC4.so
building 'Crypto.Cipher.XOR' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/XOR.c -o build/temp.linux-x86_64-2.6/src/XOR.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/XOR.o -o build/lib.linux-x86_64-2.6/Crypto/Cipher/XOR.so
building 'Crypto.Util.strxor' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/strxor.c -o build/temp.linux-x86_64-2.6/src/strxor.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/strxor.o -o build/lib.linux-x86_64-2.6/Crypto/Util/strxor.so
building 'Crypto.Util._counter' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.6 -c src/_counter.c -o build/temp.linux-x86_64-2.6/src/_counter.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/src/_counter.o -o build/lib.linux-x86_64-2.6/Crypto/Util/_counter.so
Successfully installed psycopg2 Django Markdown Pygments Twisted django-contact-form akismet Fabric BeautifulSoup django-tagging zope.interface ssh pycrypto
Cleaning up...</pre>
<h4 id="virtualenv-mod_python">Use virtualenv with Django and mod_python</h4>
<p>Here is how to use a virtualenv with
<a href="http://www.modpython.org/">mod_python</a>.
This is taken from
<em><a href="http://mydjangoblog.com/2009/03/30/django-mod_python-and-virtualenv/">
Django, mod_python and virtualenv</a></em>.
For more information, see the virtualenv documentation on
<a href="http://virtualenv.openplans.org/#using-virtualenv-without-bin-python">using
virtualenv without bin/python</a>.
</p>
<ul>
<li>Create a file <code>/srv/SaltyCrane/myvirtualdjango.py</code>:
<pre class="python">activate_this = "/srv/python-environments/saltycrane/bin/activate_this.py"
execfile(activate_this, dict(__file__=activate_this))
from django.core.handlers.modpython import handler</pre>
</li>
<li>Edit your <code>httpd.conf</code>
<pre> <Location "/">
SetHandler python-program
PythonHandler myvirtualdjango
SetEnv DJANGO_SETTINGS_MODULE iwiwdsmi.settings
PythonPath "['/srv/SaltyCrane',] + sys.path"
PythonDebug Off
</Location></pre>
</li>
</ul>
<h4 id="virtualenv-mod_wsgi">Use virtualenv with Django and mod_wsgi</h4>
<p><em>Added 2009-09-27:</em>
Here is how I set up my virtualenv with
<a href="http://code.google.com/p/modwsgi/">mod_wsgi</a>.
To use the the packages in my virtualenv,
I used <code>site.addsitedir</code> at the
top of my .wsgi application file. You may also want to set the WSGIPythonHome
variable in your httpd.conf file (outside of any VirtualHost sections). For detailed information
on using mod_wsgi with virtualenv, see the
<a href="http://code.google.com/p/modwsgi/wiki/VirtualEnvironments">Virtual
Environments section</a> of the modwsgi project documentation.
</p>
<ul>
<li><code>/srv/SaltyCrane/saltycrane.wsgi</code>:
<pre>import os
import sys
<b>import site
site.addsitedir('/srv/python-environments/saltycrane/lib/python2.5/site-packages')</b>
os.environ['DJANGO_SETTINGS_MODULE'] = 'iwiwdsmi.settings'
sys.path.append('/srv/SaltyCrane')
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()</pre>
</li>
<li><code>httpd.conf</code>:
<pre> WSGIScriptAlias / /srv/SaltyCrane/saltycrane.wsgi</pre>
</li>
</ul>
<h4 id="background">Background / Discussion</h4>
<p> Below are some links to
some essential information on pip, virtualenv, and Python packaging
(mostly from the creator of pip and virtualenv, Ian Bicking) and some further
discussion on the state of Python packaging. <em>(Updated 2012-11-17)</em>
</p>
<ul>
<li><a href="http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/">
Workingenv is dead, long live Virtualenv!</a> by Ian Bicking (2007-10-10)
</li>
<li><a href="http://groups.google.com/group/django-developers/msg/5407cdb400157259">
mailing list post explaining a number of package management technologies</a>
by Kevin Teague (2008-09-14)
</li>
<li><a href="http://www.coactivate.org/projects/topp-engineering/blog/2008/09/24/pyinstall-a-new-hope/">
pyinstall: A New Hope</a> by Ian Bicking (2008-09-24)
</li>
<li><a href="http://blog.ianbicking.org/2008/10/01/pyinstall-pybundles/">
pyinstall pybundles</a> by Ian Bicking (2008-10-01)
</li>
<li><a href="http://blog.ianbicking.org/2008/10/28/pyinstall-is-dead-long-live-pip/">
pyinstall is dead, long live pip!</a> by Ian Bicking (2008-10-28)
</li>
<li><a href="http://www.b-list.org/weblog/2008/dec/14/packaging/">
On packaging</a> by James Bennett (2008-12-14)
<li><a href="http://blog.ianbicking.org/2008/12/14/a-few-corrections-to-on-packaging/">
A Few Corrections To "On Packaging"</a> by Ian Bicking (2008-12-14)
</li>
<li><a href="http://www.b-list.org/weblog/2008/dec/15/pip/">
Why I like pip</a> by James Bennett (2008-12-15)
</li>
<li><a href="http://blog.ianbicking.org/2008/12/16/using-pip-requirements/">
Using pip Requirements</a> by Ian Bicking (2008-12-16)
</li>
<li><a href="http://guide.python-distribute.org/">
The Hitchhiker’s Guide to Packaging</a> (Documentation for distribute) (<em>Added 2010-04-13:</em>)
</li>
<li>
<a href="http://blog.ziade.org/2012/09/10/dear-django-help-python-packaging/">Dear Django, help Python Packaging</a>
by Tarek Ziadé (2012-09-10)
</li>
<li>
Brett Cannon's summary of <a href="https://plus.google.com/u/0/115362263245161504841/posts/UcBQK8P4jw3">various PEPs regarding packaging</a> (2012-09-11)</a>
</li>
<li>
<a href="http://blog.ziade.org/2012/09/12/dear-pyramid-help-python-packaging/">Dear Pyramid, help Python Packaging</a>
by Tarek Ziadé (2012-09-12)
</li>
<li>
<a href="https://twitter.com/tarek_ziade/status/269749074872373248/photo/1">The Chronology of Python Packaging Part 1</a>,
<a href="https://twitter.com/tarek_ziade/status/269754203868643328/photo/1">Part 2</a> by Tarek Ziadé (2012-11-17)
</li>
</ul>
Installing Python 2.6 from source on Ubuntu Hardy
2008-10-02T15:42:03-07:00https://www.saltycrane.com/blog/2008/10/installing-python-26-source-ubuntu-hardy/<p><a href="http://www.python.org/download/releases/2.6/">Python
2.6</a> was released yesterday! This version aims to
smooth the transition from Python 2.5 to Python 3.0 which is planned
for release soon (currently available as a
<a href="http://www.python.org/download/releases/3.0/">release candidate</a>).
Python 3.0 will be break backwards compatibility with
the 2.x series. Python 2.6 is backwards compatible with 2.5.
All the backwards compatible features of 3.0 have been backported to
2.6.</p>
<p> One of the new 2.6 features I'm particularly intersted in is
the new <a href="http://docs.python.org/dev/library/multiprocessing.html">
multiprocessing module</a> which has a similar interface to
the <a href="http://docs.python.org/dev/library/threading.html">
threading module</a>, but it uses processes instead of threads.
This avoids the limitations imposed by the Global Interpreter Lock
in a multi-threaded Python program. Yet it still has the nice
communications and management features like <code>Pipe()</code>s,
<code>Queue</code>s, <code>Pool</code>s, etc. I didn't plan to
focus so much on the multiprocessing module in this post-- I just want
to document my install notes on Ubuntu Linux. For all the new features
in 2.6 see <a href="http://docs.python.org/whatsnew/2.6.html">What's
New in Python 2.6</a>. (It is a long list).</p>
<ul>
<li>Download the Python 2.6 compressed source tarball
<pre>$ cd incoming
$ wget http://www.python.org/ftp/python/2.6/Python-2.6.tgz</pre>
</li>
<li>Unpack
<pre>$ tar zxvf Python-2.6.tgz</pre>
</li>
<li>Read the README at <code>~/incoming/Python-2.6/README</code><br><br>
</li>
<li>Install prerequisites (Disclaimer: I know nothing about libraries,
packages, dependencies, etc. This is what I did-- I am not sure
if I grabbed the correct prerequisites or not.)
<pre>$ sudo apt-get install build-essential
$ sudo apt-get install libncursesw5-dev
$ sudo apt-get install libreadline5-dev
$ sudo apt-get install libssl-dev
$ sudo apt-get install libgdbm-dev
$ sudo apt-get install libbz2-dev
$ sudo apt-get install libc6-dev
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install tk-dev</pre>
</li>
<li>Configure. I am installing to <code>~/lib/python2.6</code>.
<pre>$ cd Python-2.6
$ ./configure --prefix=/home/sofeng/lib/python2.6</pre>
</li>
<li>Make
<pre>$ make</pre>
Note I got the following message:
<pre>Failed to find the necessary bits to build these modules:
bsddb185 sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.</pre>
I was not able to find the Ubuntu packages for these.<br><br>
</li>
<li>Try it out <em>(Optional)</em>
<pre>$ ./python</pre>
<pre>Python 2.6 (r26:66714, Oct 2 2008, 15:32:46)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> </pre>
</li>
<li>Test <em>(Optional)</em>
<pre>$ make test</pre>
I got the following status:
<pre>327 tests OK.
33 tests skipped:
test_aepack test_al test_applesingle test_bsddb185 test_bsddb3
test_cd test_cl test_codecmaps_cn test_codecmaps_hk
test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_curses
test_gl test_imgfile test_kqueue test_linuxaudiodev test_macos
test_macostools test_normalization test_ossaudiodev test_pep277
test_py3kwarn test_scriptpackages test_socketserver test_startfile
test_sunaudiodev test_timeout test_urllib2net test_urllibnet
test_winreg test_winsound test_zipfile64
Those skips are all expected on linux2.</pre>
</li>
<li>Install
<pre>$ make install</pre>
</li>
<li>Finally, I added <code>~/lib/python/bin/python2.6</code> to my <code>PATH</code>
</li>
</ul>
<br>
<h5>Notes</h5>
<p>The first time I ran, I got this message:</p>
<pre>Failed to find the necessary bits to build these modules:
_hashlib _ssl bsddb185
bz2 gdbm readline
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.</pre>
<p>I think I found Ubuntu packages for some of them:</p>
<ul>
<li>_hashlib and _ssl in libssl-dev</li>
<li>bz2 in libbz2-dev</li>
<li>gdbm in libgdbm-dev</li>
<li>readline in libreadline5-dev</li>
</ul>
Somewhere on your Python path
2008-08-05T15:11:00-07:00https://www.saltycrane.com/blog/2008/08/somewhere-your-python-path/<p>As I install new python packages, I sometimes see instructions
which say something like "check out the code, and place it somewhere
on your Python path". These are very simple instructions, but
since it is not automatic like a Windows installer, or Ubuntu's
package management system, it causes me to pause. Where on my
Python path should I put it? I could put all my packages in
random places and update my PYTHONPATH environment variable every time. I also
thought about putting new packages in Python's <code>site-packages</code>
directory. This is probably a good option. However, I tend to like to
have all my important stuff in my home directory so I can easier
maintain it across multiple machines. (Also, I forget
where the <code>site-packages</code> lives (it is
<code>/usr/lib/python2.5/site-packages</code> on Ubuntu Hardy).)
So my solution was to create my own <code>python-packages</code>
directory in <code>~/lib</code>. I set the PYTHONPATH in my
<code>~/.bashrc</code> as follows:
<pre>export PYTHONPATH=$HOME/lib/python-packages</pre>
and then put all my Python packages here.
</p>
<br><br>
<p>Update: Some Python packages are distributed with other stuff besides the actual
Python package. To handle these cases, I created a <code>dist</code> directory
inside my <code>python-packages</code> directory, and created symbolic links
from the actual package directory in <code>dist</code> to
<code>python-packages</code>. Finally, I made the entire
<code>python-packages</code> directory a Mercurial repository so I can
finely control my Python environment and easily maintain it across multiple machines.
Here's what my <code>~/lib/python-packages</code> currently looks like:
</p>
<pre>drwxr-xr-x 9 sofeng sofeng 4096 2008 08/05 21:40 dist
drwxr-xr-x 4 sofeng sofeng 4096 2008 08/05 21:31 django_openidconsumer
lrwxrwxrwx 1 sofeng sofeng 43 2008 08/05 21:31 elementtree -> dist/elementtree-1.2.6-20050316/elementtree
lrwxrwxrwx 1 sofeng sofeng 31 2008 08/05 21:31 openid -> dist/python-openid-1.2.0/openid
lrwxrwxrwx 1 sofeng sofeng 31 2008 08/05 21:31 openid2.2 -> dist/python-openid-2.2.1/openid
lrwxrwxrwx 1 sofeng sofeng 27 2008 08/05 21:41 pygments -> dist/Pygments-0.10/pygments
lrwxrwxrwx 1 sofeng sofeng 29 2008 08/05 21:31 urljr -> dist/python-urljr-1.0.1/urljr
lrwxrwxrwx 1 sofeng sofeng 29 2008 08/05 21:31 yadis -> dist/python-yadis-1.1.0/yadis</pre>
<p><em>Update 2008-09-14</em>:
<a href="http://groups.google.com/group/django-developers/msg/5407cdb400157259">Here
is a post on the django-developers mailing list</a> by Kevin Teague which
explains the large number of technologies related to Python package management
and deployment including PyPi, Distutils, Eggs, Easy Install,
<a href="http://pypi.python.org/pypi/virtualenv">VirtualEnv</a>, and
<a href="http://pypi.python.org/pypi/zc.buildout">Buildout</a>. Kevin admits
that package management and deployment is an area in Python where there is room
for a great deal of improvemnt. He notes that the symlinking method
that I use can work for simple needs, but it fails for more complicated use cases,
such as tracking package dependencies. The new Virtualenv and Buildout
technologies seem to be interesting-- I will have to check them out when I have
time. I found this link <a href="http://simonwillison.net/2008/Sep/15/packaging/">via
Simon Willison</a>
</p>
<p><em>Update 2008-09-24:</em> <a href="http://blog.ianbicking.org/">Ian Bicking</a>,
author of Virtualenv, has <a href="http://www.openplans.org/projects/topp-engineering/blog/2008/09/24/pyinstall-a-new-hope/">just released pyinstall</a> which seems to be an improved easy_install. I have not tried
it yet, but I believe Ian Bicking writes good code.</p>
<p><em>Update 2008-10-24:</em><a href="http://glyph.twistedmatrix.com/">
Glyph Lefkowitz</a>, lead architect of
<a href="http://twistedmatrix.com/trac/">Twisted</a>,
suggests using
<code>twisted.python.modules</code> for solving
<a href="http://glyf.livejournal.com/71805.html">Python Path
Programming Problems</a>. This looks like something I could use in my
current project-- I just wish I understood it.</p>
<p><em>Update 2008-12-16:</em>
<ul>
<li>James Bennett (Django release manager):
<a href="http://www.b-list.org/weblog/2008/dec/14/packaging/">
Please, for the love of Guido, stop using setuptools and easy_install,
and use distutils and pip instead.</a> (pip is the new name for pyinstall,
by Ian Bicking.)</li>
<li>Ian Bicking: <a href="http://blog.ianbicking.org/2008/12/14/a-few-corrections-to-on-packaging/">
A Few Corrections To “On Packaging”</a></li>
</ul>
</p>
How to install Easy Install for Python
2007-01-10T17:50:00-08:00https://www.saltycrane.com/blog/2007/01/how-to-install-easy-install-for-python/<em>Update 2009-03-31:</em>
<ul>
<li>For current installation instructions on Windows and Cygwin, see
<a href="http://pypi.python.org/pypi/setuptools">http://pypi.python.org/pypi/setuptools</a>.</li>
<li>For a better alternative to Easy Install, see <a href="http://pip.openplans.org/">pip</a>
by <a href="http://ianbicking.org/">Ian Bicking</a></li>
</ul>
<br>
<b>How to install Easy Install on Ubuntu Linux</b>
<pre>$ sudo apt-get install python-setuptools python-dev build-essential</pre>
<br>
<div style="color: #a0a0a0; text-decoration: line-through">
<b>How to install Easy Install on Windows</b>
<ol>
<li>Go to <a href="http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install">
http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install</a>
</li>
<li>Right click on "ez_setup.py" and save the file to "c:\temp"</li>
<li>Open a cmd.exe prompt</li>
<li>"cd c:\temp"</li>
<li>"python ez_setup.py"</li>
</ol>
<br>
<b>How to install Easy Install on Cygwin</b>
<ol>
<li><code>$ cd /tmp</code></li>
<li><code>$ wget http://peak.telecommunity.com/dist/ez_setup.py</code></li>
<li><code>$ python ez_setup.py</code></li>
</ol>
</div>