Python MacOS Catalina 10.15.5 Mysqldb pip安装错误

Python MacOS Catalina 10.15.5 Mysqldb pip安装错误,python,flask,flask-mysql,Python,Flask,Flask Mysql,我在网络上尝试了各种方法,但无法通过终端安装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/j5s7f35s

我在网络上尝试了各种方法,但无法通过终端安装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."

只是确认一下,您正在使用PIP进行安装?这能解决您的问题吗?(安装命令行工具也就是说?这需要一点时间,xcode相当大)看到“检查日志以获得完整的命令输出”也会很有帮助。您可能可以使用控制台应用程序找到它:是的,使用pip安装。还有问题。我在控制台上找不到。这是您的苹果内置python安装吗?可能存在文件权限问题。我总是在我的用户文件夹中安装一个单独的python供个人使用(我建议在mac上安装anaconda,在PC上安装winpython)。只是确认一下,您使用的是PIP安装?这能解决您的问题吗?(安装命令行工具也就是说?这需要一点时间,xcode相当大)看到“检查日志以获得完整的命令输出”也会很有帮助。您可能可以使用控制台应用程序找到它:是的,使用pip安装。还有问题。我在控制台上找不到。这是您的苹果内置python安装吗?可能存在文件权限问题。我总是在我的用户文件夹中安装一个单独的python供个人使用(我推荐mac上的anaconda和PC上的winpython)。