【Django】Mac 安装pip3-install-mysqlclient 报错

1.首先在pip3-install-mysqlclient时报错

mysql_config not found

  

2.逛了一些博客 让安装mysql或者mysql-connector-c

我安装了后者还是报错,现在报了这个错误

  File "<string>", line 1, in <module>
      File "/private/var/folders/2f/r1pwfcp521q7z9kd240tr3700000gn/T/pip-build-u8yhUI/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 54, in get_config
        libraries = [dequote(i[2:]) for i in libs if i.startswith(‘-l‘)]
      File "setup_posix.py", line 12, in dequote
        if s[0] in "\"‘" and s[0] == s[-1]:
    IndexError: string index out of range

  

3.最后解决方法是修改本地的mysql_config  mac的路径:/usr/local/bin/mysql_config

vi进行修改:

# Create options
libs="-L$pkglibdir"
libs="$libs -l "

# 修改后,如下

# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"

  

原文地址:https://www.cnblogs.com/Jack-cx/p/11380196.html

时间: 2024-10-10 05:27:32

【Django】Mac 安装pip3-install-mysqlclient 报错的相关文章

Mac中 pip3 install mysqlclient 报错

主要错误提示如下: ld: library not found for -lssl clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1 ---------------------------------------- Failed building wheel for mysqlclient

pip install mysqlclient报错(OSError: mysql_config not found)

报错截图 一般情况是系统没有安装libmysqld-dev 执行 sudo apt install libmysqld-dev完成安装后再 pip install mysqlclient就可以了(系统环境Ubuntu18.04) 原文地址:https://www.cnblogs.com/IT-Crowd/p/11742384.html

mac安装beego工具bee报错 go: github.com/derekparker/[email&#160;protected]: parsing go.mod: unexpected module path &quot;github.com/go-delve/delve&quot;

主要参考URL: http://www.678fly.cn/d/3-go-mod-bee 一.创建一个 go mod 下的文件夹 mkdir test cd test go mod init test 二.在 go.mod 内把 bee 的源替换掉,如下所示: github.com/realguan/bee 是我 fork 了 github.com/beego/bee 的源码,进行了源代码更改: module test replace github.com/beego/bee v1.10.0 =

mac安装brew遇到404报错解决方案

转载 http://blog.csdn.net/starlmxx/article/details/50946643 今天安装Homebrew时用如下命令: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" 出现 curl: (22) The requested URL returned error: 400 Bad Request错误,搜了下改用如下命令就可以成功安装: ruby -e "$(cur

mac下pip install lxml报错

解决方法: brew install libxml2 xcode-select --install sudo pip install lxml -i http://pypi.v2ex.com/simple

mac下python3.6安装mysqlclient报错mysql_config: command

用mac在python3.6的环境下学习django,按照官网的步骤,却无法安装mysqlclient.报错mysql_config: command not found. 命令如下: $ pip3 install mysqlclient pip3是因为有两个python版本,给python3.6对应的pip起了个别名.不然提示找不到.报错如下: Collecting mysqlclient Using cached mysqlclient-1.3.12.tar.gz Complete outp

pip 安装mysqlclient报错OSError: mysql_config not found

执行 pip install mysqlclient 报错信息如下: [[email protected] bin]# pip install mysqlclient Collecting mysqlclient Using cached mysqlclient-1.3.12.tar.gz Complete output from command python setup.py egg_info: /bin/sh: mysql_config: command not found Tracebac

python pip安装 mysqlclient 报错 raise EnvironmentError(&quot;%s not found&quot; % (_mysql_config_path,)) OSError: mysql_config not found

raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not found 解决办法 yum install mysql-devel python pip安装 mysqlclient 报错 raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_confi

mac brew install redis 报错

mac brew install redis 报错 /usr/local/opt/php55/bin/phpize /usr/local/opt/php55/bin/phpize: line 61: /usr/local/Library/ENV/4.3/sed: No such file or directory /usr/local/opt/php55/bin/phpize: line 62: /usr/local/Library/ENV/4.3/sed: No such file or di

安装theano时候发现报错:cannot install &#39;&#39;numpy&#39;.It is a distutils installed project and thus we cannot ...

发现我安装theano的时候需要numpy需要1.9以上版本,而我之前自带的numpy是1.8版本,所以版本有问题.根本原因是theano需要的numpy版本不符合要求,但是numpy已经安装过了,所以无法进行直接卸载.提供两个解决方法: 解决方法1:直接找到numpy的安装目录,直接通过sudo rm 去对文件夹进行删除.(如果找不到文件夹,可以通过下面截图方式,一般都在dist-packages目录下) 方法2:(强行安装更新更高的版本) sudo pip install numpy --i