flask_sqlalchemy时, 为配置远程mysql目录, 报错 No module named 'MySQLdb' python3支持的数据库模块为mysqlclient, 因此安装mysqlclient报错为 mysql_config
网上很多做法是: 首先 find / -name mysql_config 在/usr/bin/下发现了这个文件 然后修改MySQL-python-1.2.5目录下的site.cfg文件 去掉mysql_config...=XXX这行的注释,并改成mysql_config=/usr/bin/mysql_config(以mysql_config文件所在机器上的目录为准) 然后 python setup.py install
cached mysqlclient-1.3.12.tar.gz Complete output from command python setup.py egg_info: /bin/sh: mysql_config...File "/tmp/pip-build-ctrzre4u/mysqlclient/setup_posix.py", line 44, in get_config libs = mysql_config...("libs_r") File "/tmp/pip-build-ctrzre4u/mysqlclient/setup_posix.py", line 26, in mysql_config...raise EnvironmentError("%s not found" % (mysql_config.path,)) OSError: mysql_config not found
███████████████| 112kB 18.8MB/s Complete output from command python setup.py egg_info: sh: mysql_config...metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config...("libs_r") File "setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not...found" % (mysql_config.path,)) EnvironmentError: mysql_config not found -------------------
raise EnvironmentError("%s not found" % (mysql_config.path,)) OSError: mysql_config not found 先安装brew
setup.py build (这里有可能会报错如下) [root@VM_162_135_centos MySQL-python-1.2.3]# python setup.py build sh: mysql_config...("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found 解决办法: a)yum install...mysql-devel libmysqlclient-dev b) [root@VM_162_135_centos ~]# find / -name mysql_config /etc/alternatives.../mysql_config /var/lib/alternatives/mysql_config /usr/bin/mysql_config /usr/lib64/mysql/mysql_config...= “/usr/bin/mysql_config”,并保存 d)继续执行python setup.py build 5、python setup.py install 到此安装完成!
not found的问题,有两种方法解决: 1)ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config 将mysql_confi...从你的安装目录链接到/usr/local/bin目录下,这样就可以在任意目录下访问了(也可以放到/usr/bin) 2)编辑源码文件夹的site.cfg文件,去掉#mysql_config = /usr.../local/bin/mysql_config前的注释#,修改后面的路径为你的mysql_config真正的目录就可以了。...(如果不知道mysql_config在哪里,运行命令:whereis mysql_config) 注:如果碰到import error: libmysqlclient.so.18: cannot open...file: No such file or directory 原因是python无法找到mysql目录下的libmysqlclient_r.so.16动态库,其实MySQLdb是调用mysql的c函数库
`mysql_config --include` -c load.c cc -w -O2 -g -I....`mysql_config --include` -c support.c cc load.o support.o `mysql_config --libs_r` -lrt -o .....`mysql_config --include` -c main.c cc -w -O2 -g -I....`mysql_config --include` -c driver.c cc -w -O2 -g -I....`mysql_config --include` -c rthist.c cc -w -O2 -g -I.
-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
安装mysqlclient库 错误:OSError: mysql_config not found 解决: ln -s /usr/local/mysql/bin/mysql_config /usr/...local/bin/mysql_config pip install mysqlclient 原因分析: mysql_config在/usr/local/bin中找不到,需要将/usr/local/mysql.../bin/mysql_config链接到此目录下即可 原文:https://blog.csdn.net/qq_38111600/article/details/80267102
我这里安装的是 mysql-python 终端中执行 pip install mysql-python 运气好的的话,直接就成功了,我遇到了一下问题,最终找到了解决方案,原因及解决方案如下,供参考 问题1:mysql_config...("libs_r") File "setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not... found" % (mysql_config.path,)) EnvironmentError: mysql_config not found---------------------... /usr/local/bin/mysql_config 原因 找不到mysql_config一般是由于通过lnmp.org或者其他方式安装mysql以后mysql_config是在/usr/local.../mysql/bin/里面,这里面的文件不是在任意位置都可以访问的,而指令是 将mysql_config链接到/usr/local/bin目录下 参考一条命令解决mysql_config not found
/configure --prefix=/usr/local/php \ --with-mysql=/path/to/mysql_config \ --with-mysqli=/path.../mysql_config \ --with-pdo-mysql=/path/mysql_config \ # 其它参数省略......PDO 提供了一个数据访问抽象层,不管使用哪种数据库,都可以用相同的函数(方法)来查询和获取数据。
█████████████| 92kB 10kB/s Complete output from command python setup.py egg_info: /bin/sh: mysql_config...File "/tmp/pip-install-p7rj4zl1/mysqlclient/setup_posix.py", line 51, in get_config libs = mysql_config...("libs") File "/tmp/pip-install-p7rj4zl1/mysqlclient/setup_posix.py", line 29, in mysql_config...raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not
最近项目移植, 再进行virtualenv环境安装的时候遇到mysql-python死活安装失败 首先是这个错误: sh: /usr/local/bin/mysql_config: No such file...File "/Users/jackey/Downloads/MySQL-python-1.2.5/setup_posix.py", line 43, in get_config libs = mysql_config...("libs_r") File "/Users/jackey/Downloads/MySQL-python-1.2.5/setup_posix.py", line 25, in mysql_config...raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: /usr/local/bin/mysql_config...sudo sed -i -e 's/libs="$libs -l "/libs="$libs -lmysqlclient -lssl -lcrypto"/g' /usr/local/mysql/bin/mysql_config
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 修改...setup_posix.py文件,在26行: mysql_config.path = “mysql_config” 修改为: mysql_config.path = “/usr/local/mysql/...bin/mysql_config” 保存后,然后再次执行: python setup.py build python setup.py install OK,到此大功告成。
setuptools 解决:安装setuptools sudo apt-get install python-setuptools sudo python setup.py install 3.2报错:mysql_config...not found 原因:mysql_config命令没有找到。...vimsetup_posix.py打开配置文件,找到mysql_config.path一行,把路径改为mysql安装路径下bin目录,即mysql_config.path =”/usr/local/mysql/bin/mysql_config...如果MySQL安装在系统默认路径下,mysql_config脚本文件位于”/usr/bin/mysql_config”。...(如果没有mysql_config,则需要安装mysql-dev包) 你可以试一下命令行直接mysql_config看下有没有安装。
MySQL-pyhon模块,网站为:https://pypi.python.org/pypi/MySQL-python/ 2、解压,进入目录,修改site.cfg文件13行,取消注释,将原路径mysql_config...= /usr/local/bin/mysql_config,改为新的mysql_config = /usr/local/mysql/bin/mysql_config(mysql路径),保存; ...3、修改setup_posix.py 文件第27行,将原路径mysql_config.path = "mysql_config"改为mysql_config.path = "/usr/local/mysql.../bin/mysql_config",保存; 4、将export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/ 加入.bash_profile,然后执行命令 soure
/usr/lib/mysql 接口函数动态链接库存放目录 /usr/share/mysql 错误消息和字符集文件存放目录 /usr/share/sql-bench 基本程序存放目录 4....return 0; } 编译:gcc test.c -o test -lmysqlclient -L/usr/lib/mysql 或:gcc test.c -o test $(mysql_config...--cflags) $(mysql_config --libs) 解释: (1) mysql_config --cflags 寻找mysql编译相关的头文件等信息。...(2) mysql_config --libs 寻找mysql编译所需要的库函数。 (3) -L/usr/lib 指出静态库寻找的路径。...(4)非标准的库函数,链接时用-lmysqlclient.原库名为libmysqlclient.a去掉lib和.a。
: command not found /bin/sh: mariadb_config: command not found /bin/sh: mysql_config: command...File "/tmp/pip-install-0ibh1u6c/mysqlclient/setup_posix.py", line 61, in get_config libs = mysql_config...("libs") File "/tmp/pip-install-0ibh1u6c/mysqlclient/setup_posix.py", line 29, in mysql_config...raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not...not found 就试试: ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
领取专属 10元无门槛券
手把手带您无忧上云