본문 바로가기
Language & Library/Python

파이썬 MySQL 설치

by 댓츠굿 2017. 9. 3.

1. PC에 mySQL 설치


1) 아래 사이트에서 본인의 PC에 맞는 파일 다운로드 하기

   (cp 다음 숫자는 python 버전임.  win32로 끝나면 32bit, amd64로 끝나면 64bit 임.)


   URL: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python



2) 설치하기

   명령프롬프트(cmd) 창에서 다운받은 파일이 있는 폴더 경로로 가서, 다음과 같이 install 명령어 실행하여 설치.


    cd C:\Users\Downloads


    pip install mysqlclient‑1.3.12‑cp36‑cp36m‑win32.whl



3. PyMySQL 설치 

   파이썬에서 PyMySQL을 이용하여 MySQL 쓸 때, 다음과 같은 라이브러리 설치

    pip install PyMySQ

    


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


[시행착오]


   난 윈도 64bit라 mysqlclient‑1.3.12‑cp36‑cp36m‑win_amd64.whl 다운받아 설치하니 다음과 같은 에러가 남.


    "mysqlclient-1.3.12-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform."


   구글링을 해보니, 다음과 같은 해결책을 찾음.


I had the same problem while installing scipy-0.17.0-cp35-none-win_amd64.whl and my Python version is 3.5. It returned the same error message:

 scipy-0.17.0-cp35-none-win_amd64.whl is not supported wheel on this platform.

I realized that amd64 is not about my Windows, but about the Python version. Actually I am using a 32 bit Python on a 64 bit Windows. Installing the following file solved the issue:

scipy-0.17.0-cp35-none-win32.whl
shareimprove this answer

    (출처: https://stackoverflow.com/questions/28568070/filename-whl-is-not-supported-wheel-on-this-platform)


   

    즉, mysqlclient‑1.3.12‑cp36‑cp36m‑win_amd64.whl 대신 

        mysqlclient‑1.3.12‑cp36‑cp36m‑win32.whl 설치하니 됨.

    

    cf.) 64비트의 내 친구 PC에서는 mysqlclient‑1.3.12‑cp36‑cp36m‑win_amd64.whl 설치가 잘 되었음.

반응형