1.你有一台MAC
2.easy_install web.py
3.安装MySql链接库,注意Xcode 5.1中的苹果编译器将不认识的命令行视为错误行为。这类报错常出现在ruby和python的安装过程中,因为这两类程序中,很多编译语句较为特殊。所以需要在常规安装语句前面加上红字部分:
sudo $ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install MySQL-python
4.添加两个符号链接(软链接),不然会报错:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
5.cd [you workspace] then python index.py