- A+
1、windows下安装MySQLdb,直接github上的编译包,下载后安装报错:
2、于是通过whl文件安装:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
安装OK,执行charset=utf8mb4 依然报错,
而该路径本身就不存在,
结合linux下安装处理的方式,应该是安装时mysql路径指定的问题:
3、linux下安装踩坑:
(1)安装报错
File "setup.py", line 17, in <module> metadata, options = get_config() File "/home/tool/MySQLdb1/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/home/tool/MySQLdb1/setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found
修改site.cfg 中mysql_config对应位置:
安装OK
4、windows参考说明
# http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip
# Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build.
connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2
下载地址:https://downloads.mysql.com/archives/c-c/
安装后还是报错:
参考:
https://github.com/farcepest/MySQLdb1
https://blog.csdn.net/lh12332/article/details/82625055
https://www.cnblogs.com/hark0623/p/7599899.html
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫