MacOS Catalina 10.15.5 FlaskMysqldb pip安装错误

2024-10-03 09:07:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我在网络上尝试了各种方法,但无法通过终端安装flask mysql db。我总是犯这个错误

"ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/78/j5s7f35s7tbfp971ftclk9d00000gn/T/pip-install-dfntjsy3/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/78/j5s7f35s7tbfp971ftclk9d00000gn/T/pip-install-dfntjsy3/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/78/j5s7f35s7tbfp971ftclk9d00000gn/T/pip-record-wl2niv7i/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/mysqlclient Check the logs for full command output." 

编辑:为可读性格式化的错误字符串:

#"ERROR: Command errored out with exit status 1: 
    #/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 

        import sys, setuptools, tokenize; 
        sys.argv[0] = '/private/var/folders/78/j5s7f35s7tbfp971ftclk9d00000gn/T/pip-install-dfntjsy3/mysqlclient/setup.py' 
        __file__=     '/private/var/folders/78/j5s7f35s7tbfp971ftclk9d00000gn/T/pip-install-dfntjsy3/mysqlclient/setup.py'
        f=getattr(tokenize, 'open', open)(__file__);
        code=f.read().replace('\r\n', '\n');
        f.close();
        exec(compile(code, __file__, 'exec'))

    #install 
    #--record /private/var/folders/78/j5s7f35s7tbfp971ftclk9d00000gn/T/pip-record-wl2niv7i/install-record.txt 
    #--single-version-externally-managed 
    #--compile 
    #--install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/mysqlclient 

#Check the logs for full command output."

Tags: installpipvarsyslibraryframeworkprivaterecord