在苹果系统中安装安装 MySQL-python比在windows中稍要难一点了,下面是整个安装 MySQL-python的过程,希望大家参考后会有所帮助.
重新安装easy_install(setuptools)
1,去下载 https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
2,到终端执行 sudo sh setuptools-0.6c11-py2.7.egg
3,清除下载的setuptools-0.6c11-py2.7.egg
删除MySQL:
- sudorm/usr/local/mysql
- sudorm-rf/usr/local/mysql*
- sudorm-rf/Library/StartupItems/MySQLCOM
- sudorm-rf/Library/PreferencePanes/MySQL*
- vim/etc/hostconfigandremovedthelineMYSQLCOM=-YES-
- rm-rf~/Library/PreferencePanes/MySQL*
- sudorm-rf/Library/Receipts/mysql*
- sudorm-rf/Library/Receipts/MySQL*
- sudorm-rf/var/db/receipts/com.mysql.*
Mac下删除自己安装的Python
删除Python框架:sudo rm -rf /Library/Frameworks/Python.framework/Versions/x.x
删除Python程序:sudo rm -rf “/Applications/Python x.x”
删除/usr/local/bin目录下的Python连接:x.x为Python的版本号
安装PHP开发环境
MAMP 都有了
安装Python开发环境
受累MAMP,被MySQLdb折腾好久。最后,删除了python重新来过。
安装python
安装wxpython
安装easy_install
安装mysql-5.1.73-osx10.6-x86_64(64位的mysql,就是为了安装下面的MySQLdb)
编辑.bash_profile:
- #SettingPATHforMySQLdb
- PATH="/usr/local/mysql-5.1.73-osx10.6-x86_64/bin:${PATH}"
- exportPATH
- exportDYLD_LIBRARY_PATH="/usr/local/mysql-5.1.73-osx10.6-x86_64/lib"//开源代码phpfensi.com
- exportVERSIONER_PYTHON_PREFER_64_BIT=no
- exportVERSIONER_PYTHON_PREFER_32_BIT=yes
安装MySQL-python(sudo easy_install MySQL-python).