Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我无法安装mysqlclient_Python_Mysql_Django - Fatal编程技术网

Python 我无法安装mysqlclient

Python 我无法安装mysqlclient,python,mysql,django,Python,Mysql,Django,您需要安装VisualC++的构建工具。你可以下载它们。然后再次尝试安装mysqlclient 或 第二个选项您也可以通过二进制文件安装它 pip install mysqlclient Collecting mysqlclient Using cached mysqlclient-2.0.3.tar.gz (88 kB) Using legacy setup.py install for mysqlclient, since package 'wheel' is not installe

您需要安装VisualC++的构建工具。你可以下载它们。然后再次尝试安装
mysqlclient

第二个选项您也可以通过二进制文件安装它

 pip install mysqlclient
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: 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\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\Blackknight\AppData\Local\Temp\pip-record-7y2zgqqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\blackknight\desktop\simpleblog\myenv\include\site\python3.8\mysqlclient'
         cwd: C:\Users\Blackknight\AppData\Local\Temp\pip-install-85jgwelt\mysqlclient\
    Complete output (23 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
    running build_ext
    building 'MySQLdb._mysql' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ 
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Blackknight\\AppData\\Local\\Temp\\pip-install-85jgwelt\\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\Blackknight\AppData\Local\Temp\pip-record-7y2zgqqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\blackknight\desktop\simpleblog\myenv\include\site\python3.8\mysqlclient' Check the logs for full command output.
WARNING: You are using pip version 20.1.1; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\blackknight\desktop\simpleblog\myenv\scripts\python.exe -m pip install --upgrade pip' command.
可选: 最好是升级运行pip的pip
pip安装——升级pip

pip install --only-binary :all: mysqlclient