gpt4 book ai didi

python - python setup.py egg_info mysqlclient

转载 作者:行者123 更新时间:2023-12-03 13:39:24 28 4
gpt4 key购买 nike

尝试在Python 3.6.0上使用pip3安装mysqlclient

$ pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.10.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/setup_posix.py", line 54, in get_config
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/setup_posix.py", line 54, in <listcomp>
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/setup_posix.py", line 12, in dequote
if s[0] in "\"'" and s[0] == s[-1]:
IndexError: string index out of range

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3k/08g3yx_12kg99kyfs989md600000gn/T/pip-build-1qv_89jc/mysqlclient/

已经做了
brew install mysql-connector-c

但是仍然出现此错误

最佳答案

这为我工作:

  • brew install mysql-connector-c
  • 编辑mysql_config(找到它:which mysql_config)

  • 在mysql_config中更正此错误:
    # Create options 
    libs="-L$pkglibdir"
    libs="$libs -l "

    应该是:
    # Create options 
    libs="-L$pkglibdir"
    libs="$libs -lmysqlclient -lssl -lcrypto"
  • brew info openssl
  • ,最后是pip3 install mysqlclient
  • 关于python - python setup.py egg_info mysqlclient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43740481/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com