Howto Install Webpy
My new favorite web framework runs on python. It's called Web.py. And I'm not the only one who likes it. The guys over at Reddit seem to have taken an interest in it as well. In this post, I'm going to show you how to set up a development environment for Web.py.
First, you'll want to make sure you have python installed. Webpy will run on older versions of python, but I recommend 2.5x.
Next we'll install MySql. You have a few options here:
- If you're on a Mac, download Mysql and install it via package.
- If you're on linux, run apt-get or yum to install mysql.
- If you're on windows, just download and install Xampp.
No matter what OS you're running, go ahead and install Xampp. It's the easiest way to get pypmyadmin up and running. Next, head over to webpy's site and download the latest version (0.23 as of this writing). Extract the archive's files and run the following command.
python setup.py install
Since we'll be using mysql with webpy, lets install a popular mysql library for python. You can download it here. If you're on windows, you can go ahead and download the exe. If you're on linux, run the following command:
sudo easy_install MySQL-python
If you're on a mac, there's a bit more work involved. As of this writing, I'm using MySQL version 5.0.51b and MySQL-python version 1.2.2. You'll need to extract the files from the MySQL-python tarball and edit setup_posix.py. Replace the following line:
mysql_config.path = "mysql_config"
with...
mysql_config.path = "/usr/local/mysql-5.0.51b-osx10.5-x86/bin/mysql_config"
The actual path may vary if you are using a different version of mysql, so be aware of that. Once that is done, run the following command in the MySQL-python directory:
sudo python setup.py build
If all goes as planned, MySQL-python will be built and copied over to your python installation.
Congratulations! Web.py is officially installed. In my next post I'll show you how to make a simple Web.py application. If you can't wait, head over to webpy's official site and check out their tutorial.
June 10th, 2008 / Tags: webpy, web.py, tutorial, python, framework / Trackback

