DjangoMac 安装pip3-install-mysqlclient 报错
Posted jack-cx
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DjangoMac 安装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"
以上是关于DjangoMac 安装pip3-install-mysqlclient 报错的主要内容,如果未能解决你的问题,请参考以下文章