반응형

$ pip install mysqlclient

Collecting mysqlclient

  Downloading https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz (85kB)

    100% |████████████████████████████████| 92kB 535kB/s 

    Complete output from command python setup.py egg_info:

    /bin/sh: mysql_config: command not found

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-7x42pkjs/mysqlclient/setup.py", line 16, in <module>

        metadata, options = get_config()

      File "/private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-7x42pkjs/mysqlclient/setup_posix.py", line 51, in get_config

        libs = mysql_config("libs")

      File "/private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-7x42pkjs/mysqlclient/setup_posix.py", line 29, in mysql_config

        raise EnvironmentError("%s not found" % (_mysql_config_path,))

    OSError: mysql_config not found

    

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-7x42pkjs/mysqlclient/

 

난 로컬에 mysql을 설치하였으므로 mysql_config가 있는 위치를 패스에 추가해서 설치해봤는데도 못읽어옴

 

mysql-connector-c를 설치해줘야한다고 해서 설치

brew install mysql-connector-c

했더니 에러메시지가 달라짐

 

$ pip install mysqlclient

Collecting mysqlclient

  Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.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/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-4z_dh6jw/mysqlclient/setup.py", line 16, in <module>

        metadata, options = get_config()

      File "/private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-4z_dh6jw/mysqlclient/setup_posix.py", line 53, in get_config

        libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]

      File "/private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-4z_dh6jw/mysqlclient/setup_posix.py", line 53, in <listcomp>

        libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]

      File "/private/var/folders/50/flbhnc592cdd9bdvjz31g85c0000gn/T/pip-install-4z_dh6jw/mysqlclient/setup_posix.py", line 12, in dequote

        raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")

    Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?

 

위 주소로 가봤는데 case만 오픈되어있는 상태였다.

 

다르게 검색해봤더니 mysqlclient가 macOS에서 bug가 있고, 깃허브에 해결방법이 나와있었음

https://github.com/PyMySQL/mysqlclient-python#board

 

PyMySQL/mysqlclient-python

MySQL database connector for Python (with Python 3 support) - PyMySQL/mysqlclient-python

github.com

소스 수정하고 다시 설치하니 잘 되더이다.

 

 

반응형

+ Recent posts