Saltycrane logo

SaltyCrane Blog

Notes on Python, Django, and web development on Ubuntu Linux

     Posts tagged "install_setup"

How to install MySQLdb in a virtualenv on Ubuntu Karmic

  • Install dependencies
    sudo apt-get build-dep python-mysqldb
  • Install MySQLdb with pip/virtualenv
    cd ~/lib/python-environments
    virtualenv --distribute --no-site-packages default
    pip install -E default/ MySQL-python

EnvironmentError: mysql_config not found

The first time, I did not install the dependencies and got the following error:

$ 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 ...
... read more »

How to install pip on Ubuntu

Pip is a better alternative to Easy Install for installing Python packages. For more information on pip and its companion, virtualenv, see my blog post: Notes on using pip and virtualenv with Django.

  • Install Easy Install
    sudo apt-get install python-setuptools python-dev build-essential
  • Install pip
    sudo easy_install pip
... read more »

Using psycopg2 with virtualenv on Ubuntu JauntyLucid

Update 2009-11-02: 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 apt-get build-dep. So, here's the summary:

Update 2009-11-11: My update doesn't work. See comments #4 and #5 below.

Update 2010-05-17: 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 Daniel for the final piece of the solution.

Install dependencies

$ sudo apt-get build-dep python-psycopg2

Install ...

... read more »

Notes on using pip and virtualenv with Django

I have been using a symlinking method to install Python packages up to this point. To better handle dependencies and multiple versions I have wanted to switch over to pip and virtualenv. Pip is a better alternative to Easy Install 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 IntrepidKarmic and Python 2.52.6.)

A lot ...

... read more »

Installing Python 2.6 from source on Ubuntu Hardy

Python 2.6 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 release candidate). 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.

One of the new 2.6 features I'm particularly intersted in is the new multiprocessing module which has a similar interface to the threading module, but it uses processes instead ...

... read more »

Somewhere on your Python path

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 site-packages directory. This is probably a good option. However, I tend to ...

... read more »

How to install Easy Install for Python

Update 2009-03-31:
How to install Easy Install on Ubuntu Linux
$ sudo apt-get install python-setuptools python-dev build-essential

How to install Easy Install on Windows
  1. Go to http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install
  2. Right click on "ez_setup.py" and save the file to "c:\temp"
  3. Open a cmd.exe prompt
  4. "cd c:\temp"
  5. "python ez_setup.py"

How to install Easy Install on Cygwin
  1. $ cd /tmp
  2. $ wget http://peak.telecommunity.com/dist/ez_setup.py
  3. $ python ...
... read more »
Created with Django | Hosted by Slicehost