Pip install mysqlclient error mac

 Using cached mysqlclient-1.3.0.tar.gz [76 kB]
    ERROR: Command errored out with exit status 1:
     command: /Users/mr.sallam/.local/share/virtualenvs/Admission_System-h6ReVRNX/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-install-cn6qvsqm/mysqlclient_c82e6a9eeefe4d66bf9960f11336d0db/setup.py'"'"'; __file__='"'"'/private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-install-cn6qvsqm/mysqlclient_c82e6a9eeefe4d66bf9960f11336d0db/setup.py'"'"';f=getattr[tokenize, '"'"'open'"'"', open][__file__];code=f.read[].replace['"'"'\r\n'"'"', '"'"'\n'"'"'];f.close[];exec[compile[code, __file__, '"'"'exec'"'"']]' egg_info --egg-base /private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-pip-egg-info-186pdzul
         cwd: /private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-install-cn6qvsqm/mysqlclient_c82e6a9eeefe4d66bf9960f11336d0db/
    Complete output [10 lines]:
    /bin/sh: mysql_config: command not found
    Traceback [most recent call last]:
      File "", line 1, in 
      File "/private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-install-cn6qvsqm/mysqlclient_c82e6a9eeefe4d66bf9960f11336d0db/setup.py", line 17, in 
        metadata, options = get_config[]
      File "/private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-install-cn6qvsqm/mysqlclient_c82e6a9eeefe4d66bf9960f11336d0db/setup_posix.py", line 47, in get_config
        libs = mysql_config["libs_r"]
      File "/private/var/folders/58/khmzr9l90hx237729cjz2ct00000gn/T/pip-install-cn6qvsqm/mysqlclient_c82e6a9eeefe4d66bf9960f11336d0db/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError["%s not found" % [mysql_config.path,]]
    OSError: mysql_config not found
    ----------------------------------------
WARNING: Discarding //files.pythonhosted.org/packages/6a/91/bdfe808fb5dc99a5f65833b370818161b77ef6d1e19b488e4c146ab615aa/mysqlclient-1.3.0.tar.gz#sha256=06eb5664e3738b283ea2262ee60ed83192e898f019cc7ff251f4d05a564ab3b7 [from //pypi.org/simple/mysqlclient/]. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysqlclient
ERROR: No matching distribution found for mysqlclient

Python: 3.9.5
mysql: 8.0.25

Trying to install mysqlclient for setting up connection with django but failing with the below output:

Collecting mysqlclient
  Using cached mysqlclient-2.0.3.tar.gz [88 kB]
Using legacy 'setup.py install' for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/mketan/Documents/diit/diit_env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-install-fbu018c0/mysqlclient_64e4fa21b76648ff84f8c751e242384d/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-install-fbu018c0/mysqlclient_64e4fa21b76648ff84f8c751e242384d/setup.py'"'"';f = getattr[tokenize, '"'"'open'"'"', open][__file__] if os.path.exists[__file__] else io.StringIO['"'"'from setuptools import setup; setup[]'"'"'];code = f.read[].replace['"'"'\r\n'"'"', '"'"'\n'"'"'];f.close[];exec[compile[code, __file__, '"'"'exec'"'"']]' install --record /private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-record-3wl14yep/install-record.txt --single-version-externally-managed --compile --install-headers /Users/b0223621/Documents/diit/diit_env/include/site/python3.9/mysqlclient
         cwd: /private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-install-fbu018c0/mysqlclient_64e4fa21b76648ff84f8c751e242384d/
    Complete output [43 lines]:
    mysql_config --version
    ['8.0.25']
    mysql_config --libs
    ['-L/opt/homebrew/Cellar/mysql/8.0.25_1/lib', '-lmysqlclient', '-lz', '-lzstd', '-lssl', '-lcrypto', '-lresolv']
    mysql_config --cflags
    ['-I/opt/homebrew/Cellar/mysql/8.0.25_1/include/mysql']
    ext_options:
      library_dirs: ['/opt/homebrew/Cellar/mysql/8.0.25_1/lib']
      libraries: ['mysqlclient', 'zstd', 'resolv']
      extra_compile_args: ['-std=c99']
      extra_link_args: []
      include_dirs: ['/opt/homebrew/Cellar/mysql/8.0.25_1/include/mysql']
      extra_objects: []
      define_macros: [['version_info', "[2,0,3,'final',0]"], ['__version__', '2.0.3']]
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-universal2-3.9
    creating build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/connections.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/converters.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/release.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    copying MySQLdb/times.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb
    creating build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-universal2-3.9/MySQLdb/constants
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build/temp.macosx-10.9-universal2-3.9
    creating build/temp.macosx-10.9-universal2-3.9/MySQLdb
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/bzip2/include -I/opt/homebrew/opt//include -Dversion_info=[2,0,3,'final',0] -D__version__=2.0.3 -I/opt/homebrew/Cellar/mysql/8.0.25_1/include/mysql -I/Users/b0223621/Documents/diit/diit_env/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-universal2-3.9/MySQLdb/_mysql.o -std=c99
    gcc -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -g -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/bzip2/lib -L/opt/homebrew/opt//lib -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/bzip2/include -I/opt/homebrew/opt//include build/temp.macosx-10.9-universal2-3.9/MySQLdb/_mysql.o -L/opt/homebrew/Cellar/mysql/8.0.25_1/lib -lmysqlclient -lzstd -lresolv -o build/lib.macosx-10.9-universal2-3.9/MySQLdb/_mysql.cpython-39-darwin.so
    ld: library not found for -lzstd
    clang: error: linker command failed with exit code 1 [use -v to see invocation]
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/b0223621/Documents/diit/diit_env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-install-fbu018c0/mysqlclient_64e4fa21b76648ff84f8c751e242384d/setup.py'"'"'; __file__='"'"'/private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-install-fbu018c0/mysqlclient_64e4fa21b76648ff84f8c751e242384d/setup.py'"'"';f = getattr[tokenize, '"'"'open'"'"', open][__file__] if os.path.exists[__file__] else io.StringIO['"'"'from setuptools import setup; setup[]'"'"'];code = f.read[].replace['"'"'\r\n'"'"', '"'"'\n'"'"'];f.close[];exec[compile[code, __file__, '"'"'exec'"'"']]' install --record /private/var/folders/qm/kp4ls0ds5q7gh4rtfqy4xxrr0000gn/T/pip-record-3wl14yep/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mketan/Documents/diit/diit_env/include/site/python3.9/mysqlclient Check the logs for full command output.

How do I download Mysqlclient on Mac?

Install MySQL and MySQLClient[Python] in MacOS.
Step one: install Homebrew..
Step two: install MySQL..
Step three: install MySQL-Connector-C..
Step four: install XCode-Select..
Step five: install OpenSSL..
Step six: unlink MySQL and link MySQL-Connector-C..
Step seven: install mysqlclient..
Step eight: link MySQL back again..

What is Mysqlclient in python?

What is mysqlclient ? This is a database client application that serves as the medium/interface between the user running Python codes and the mysql database. mysqlclient was developed to replace MySql-python and provides support for Python3, although it is backward compatible as well.

How install MySQL on MacOS Sierra?

How To Install MySQL on Mac OS X High Sierra [Easy].
Download the right version for your operating system here. You might have to go to the product archives drop down menu and select the appropriate one. ... .
Install MySQL Database Server. ... .
Where to find your MySQL server. ... .
Install MySQL Workbench. ... .
6 Comments..

Chủ Đề