在苹果系统中安装安装 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:
- sudo rm /usr/local/mysql
- sudo rm -rf /usr/local/mysql*
- sudo rm -rf /Library/StartupItems/MySQLCOM
- sudo rm -rf /Library/PreferencePanes/MySQL*
- vim /etc/hostconfig and removed the line MYSQLCOM=-YES-
- rm -rf ~/Library/PreferencePanes/MySQL*
- sudo rm -rf /Library/Receipts/mysql*
- sudo rm -rf /Library/Receipts/MySQL*
- sudo rm -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:
- # Setting PATH for MySQLdb
-
- PATH="/usr/local/mysql-5.1.73-osx10.6-x86_64/bin:${PATH}"
- export PATH
- export DYLD_LIBRARY_PATH="/usr/local/mysql-5.1.73-osx10.6-x86_64/lib"
- export VERSIONER_PYTHON_PREFER_64_BIT=no
- export VERSIONER_PYTHON_PREFER_32_BIT=yes
安装MySQL-python(sudo easy_install MySQL-python). |