티스토리 뷰

[ 상황 ]



mysql-python 을 설치하려고 하는데 자꾸 에러가 난다.



sh-3.2# pip install mysql-python

Collecting mysql-python

  Using cached MySQL-python-1.2.5.zip

    Complete output from command python setup.py egg_info:

    sh: mysql_config: command not found

    Traceback (most recent call last):

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

      File "/private/tmp/pip-build-fEo3YN/mysql-python/setup.py", line 17, in <module>

        metadata, options = get_config()

      File "setup_posix.py", line 43, in get_config

        libs = mysql_config("libs_r")

      File "setup_posix.py", line 25, in mysql_config

        raise EnvironmentError("%s not found" % (mysql_config.path,))

    EnvironmentError: mysql_config not found

    

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

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-fEo3YN/mysql-python/





[ 해결 방법 ]


mysql을 설치해줬다.



$ brew install mysql

==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.18_1.sierra.bottl

######################################################################## 100.0%

==> Pouring mysql-5.7.18_1.sierra.bottle.tar.gz

==> Using the sandbox

==> /usr/local/Cellar/mysql/5.7.18_1/bin/mysqld --initialize-insecure --user=urb

==> Caveats

We've installed your MySQL database without a root password. To secure it run:

    mysql_secure_installation


MySQL is configured to only allow connections from localhost by default


To connect run:

    mysql -uroot


To have launchd start mysql now and restart at login:

  brew services start mysql

Or, if you don't want/need a background service you can just run:

  mysql.server start

==> Summary

🍺  /usr/local/Cellar/mysql/5.7.18_1: 321 files, 232.9MB





그리고 다시 설치해보니 된다.




sh-3.2# pip install mysql-python

Collecting mysql-python

  Using cached MySQL-python-1.2.5.zip

Building wheels for collected packages: mysql-python

  Running setup.py bdist_wheel for mysql-python ... done

  Stored in directory: /var/root/Library/Caches/pip/wheels/38/a3/89/ec87e092cfb38450fc91a62562055231deb0049a029054dc62

Successfully built mysql-python

Installing collected packages: mysql-python

Successfully installed mysql-python-1.2.5

sh-3.2# 














댓글
최근에 올라온 글
Total
Today
Yesterday