0

I've been Googling for hours and hours and still have no idea...

Collecting Flask-MySQLdb
  Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Requirement already satisfied: Flask>=0.10 in c:\users\고명수\pycharmprojects\pythonproject\venv\lib\site-packages (from Flask-MySQLdb) (1.1.2)
Collecting mysqlclient
  Using cached mysqlclient-2.0.1.tar.gz (87 kB)
Requirement already satisfied: Werkzeug>=0.15 in c:\users\고명수\pycharmprojects\pythonproject\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (1.0.1)
Requirement already satisfied: itsdangerous>=0.24 in c:\users\고명수\pycharmprojects\pythonproject\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (1.1.0)
Requirement already satisfied: click>=5.1 in c:\users\고명수\pycharmprojects\pythonproject\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (7.1.2)
Requirement already satisfied: Jinja2>=2.10.1 in c:\users\고명수\pycharmprojects\pythonproject\venv\lib\site-packages (from Flask>=0.10->Flask-MySQLdb) (2.11.2)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\고명수\pycharmprojects\pythonproject\venv\lib\site-packages (from Jinja2>=2.10.1->Flask>=0.10->Flask-MySQLdb) (1.1.1)
Using legacy setup.py install for Flask-MySQLdb, since package 'wheel' is not installed.
Using legacy setup.py install for mysqlclient, since package 'wheel' is not installed.
Installing collected packages: mysqlclient, Flask-MySQLdb
    Running setup.py install for mysqlclient: started
    Running setup.py install for mysqlclient: finished with status 'error'

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\고명수\PycharmProjects\pythonProject\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\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 'C:\Users\고명수\AppData\Local\Temp\pip-record-n9_1w3tr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\고명수\PycharmProjects\pythonProject\venv\include\site\python3.8\mysqlclient'
         cwd: C:\Users\고명수\AppData\Local\Temp\pycharm-packaging\mysqlclient\
    Complete output (31 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb
    copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
    creating build\lib.win32-3.8\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
    warning: build_py: byte-compiling is disabled, skipping.
    
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    creating build\temp.win32-3.8\Release\MySQLdb
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(2,0,1,'final',0) -D__version__=2.0.1 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -IC:\Users\고명수\PycharmProjects\pythonProject\venv\include -IC:\Users\고명수\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\고명수\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.8\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
    _mysql.c
    MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\고명수\PycharmProjects\pythonProject\venv\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\고명수\\AppData\\Local\\Temp\\pycharm-packaging\\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 'C:\Users\고명수\AppData\Local\Temp\pip-record-n9_1w3tr\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\고명수\PycharmProjects\pythonProject\venv\include\site\python3.8\mysqlclient' Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the 'C:\Users\고명수\PycharmProjects\pythonProject\venv\Scripts\python.exe -m pip install --upgrade pip' command.

Even when I tried to upgrade pip at the exact directory, it just shows this issue here

Even when I tried to upgrade pip at the exact directory, it just shows this issue here... I'd tried a lot to solve this on my own and about to give up.. Why is it so hard to download one pacakage (Flask-MySQLDB)

Soo
  • 33
  • 1
  • 6
  • Does this answer your question? [pip install mysqlclient returns "fatal error C1083: Cannot open file: 'mysql.h': No such file or directory](https://stackoverflow.com/questions/51294268/pip-install-mysqlclient-returns-fatal-error-c1083-cannot-open-file-mysql-h) – phd Aug 24 '20 at 12:58
  • https://stackoverflow.com/search?q=%5Bpip%5D+flask-mysqldb – phd Aug 24 '20 at 12:58

2 Answers2

0

You need the Build Tools for Visual Studio.

Download it from here: 

Link

Once you run the application, you have to select the Windows 10 SDK and install that.

That will fix your errors.

Jimit Vaghela
  • 768
  • 1
  • 8
  • 31
0

you never had to install visual studio build tools. instead try installing the other same modules,

pip install pymysql
pip install mysql-connector
pip install mysql-connector-python

note:

all the modules listed above are the same

Ahmad Waqar
  • 474
  • 4
  • 7