Hướng dẫn error: failed building wheel for mysqlclient mac - lỗi: không xây dựng được bánh xe cho mac mysqlclient

Tôi đang cố gắng chạy Windows của mình đã tạo tập lệnh Python trên macOS.

Tôi đã quản lý để cài đặt tất cả các mô -đun cần thiết ngoài MySQLDB.

Tôi đang cố gắng cài đặt từ PIP3 bằng lệnh này:

pip3 install mysqlclient

Nhưng nhận được một lỗi lớn:

    Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-wheel-md6mses2 --python-tag cp37
       cwd: /private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/mysqlclient/
  Complete output (30 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-x86_64-3.7
  creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/_exceptions.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/compat.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
  creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
  running build_ext
  building 'MySQLdb._mysql' extension
  creating build/temp.macosx-10.14-x86_64-3.7
  creating build/temp.macosx-10.14-x86_64-3.7/MySQLdb
  xcrun -sdk macosx clang -arch x86_64 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/local/Cellar/mysql-connector-c/6.1.11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o
  xcrun -sdk macosx clang -arch x86_64 -bundle -undefined dynamic_lookup build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
  ld: library not found for -lssl
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command 'xcrun' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
     command: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/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/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-record-zi37f1af/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/mysqlclient/
    Complete output (30 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.7
    creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/_exceptions.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/compat.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb
    creating build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-x86_64-3.7/MySQLdb/constants
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build/temp.macosx-10.14-x86_64-3.7
    creating build/temp.macosx-10.14-x86_64-3.7/MySQLdb
    xcrun -sdk macosx clang -arch x86_64 -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/Headers -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/local/Cellar/mysql-connector-c/6.1.11/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o
    xcrun -sdk macosx clang -arch x86_64 -bundle -undefined dynamic_lookup build/temp.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'xcrun' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-install-cbceeulv/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/11/bj20_z594y1562dx9p3bc4km0000gn/T/pip-record-zi37f1af/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Tôi đã thử nhiều bài viết trên diễn đàn mà tôi đã tìm thấy và không có gì đang hoạt động.Tôi cũng đã cố gắng xây dựng từ nguồn nhưng tôi gặp lỗi về ConfigParser không được cài đặt - nó đã được thông qua PIP.

Xin ai đó có thể giúp đỡ?!

P.S PIP đã được cập nhật lên phiên bản mới nhất.