1.安装setuptools-0.6c11wget --no-check-certificate Http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.
1.安装setuptools-0.6c11
wget --no-check-certificate Http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxf setuptools-0.6c11.tar.gz && cd setuptools-0.6c11
Python setup.py build
python setup.py install
2.安装Mysql-python-1.2.3
wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download
tar zxf MySQL-python-1.2.3.tar.gz && cd MySQL-python-1.2.3
python setup.py build
python setup.py install
如果在执行python setup.py build时,报EnvironmentError: mysql_config not found的话,先查找mysql_config的位置,使用find / -name mysql_config,我的是在/usr/local/mysql/bin/mysql_config,然后修改MySQL-python-1.2.3目录下的site.cfg文件,去掉mysql_config=XXX这行的注释,并改成mysql_config=/usr/local/mysql/bin/mysql_config,以自己机器的为准.
再执行下面命令就可以了
python setup.py build
python setup.py install
--结束END--
本文标题: python安装mysqldb
本文链接: https://lsjlt.com/news/184824.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0