码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2019-08-19 22:48:12      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:config   ror   pos   lib   erro   bin   string   module   for   

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"

  

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

标签:config   ror   pos   lib   erro   bin   string   module   for   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!