python - django 无法构建 mysqlclient
问题描述
我在Window 7上创建了一个示例 Django 应用程序,我正在使用Python V3.6和Django 2.1来处理我们计划使用 Mysql 数据库的应用程序。所以我尝试通过命令安装pip install django mysqlclient
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\ccduce\appdata\local\continuum\miniconda3\python.exe -u -c "import setuptoo
ls, tokenize;__file__='C:\\Users\\ccduce\\AppData\\Local\\Temp\\pip-install-dw406d2r\\mysqlclient\\setup.py';f=getatt
r(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'
))" install --record C:\Users\ccduce\AppData\Local\Temp\pip-record-je8ir8xy\install-record.txt --single-version-exter
nally-managed --compile:
c:\users\ccduce\appdata\local\continuum\miniconda3\lib\distutils\dist.py:261: UserWarning: Unknown distribution o
ption: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
copying _mysql_exceptions.py -> build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\MySQLdb
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.6\MySQLdb\constants
running build_ext
building '_mysql' extension
error: [WinError 3] The system cannot find the path specified: 'C:\\Program Files (x86)\\Microsoft Visual Studio
14.0\\VC\\PlatformSDK\\lib'
----------------------------------------
Command "c:\users\ccduce\appdata\local\continuum\miniconda3\python.exe -u -c "import setuptools, tokenize;__file__='C
:\\Users\\ccduce\\AppData\\Local\\Temp\\pip-install-dw406d2r\\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\ccduce\AppData\Local\Temp\pip-record-je8ir8xy\install-record.txt --single-version-externally-managed --compile"
failed with error code 1 in C:\Users\ccduce\AppData\Local\Temp\pip-install-dw406d2r\mysqlclient\
设置.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '*****',
'USER': '****',
'PASSWORD': '******',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
我需要安装任何SDK来解决这个问题吗?
解决方案
推荐阅读
- c# - 无法在 WiFi 客户端设备中从 C# 创建的热点和 HTTP 服务器查看网页?
- java - Java Libgdx/OpenGL,精灵不改变颜色/绘图的原因
- javascript - 如何在同步 java 脚本中打印异步操作的响应?
- javascript - 我对 Firebase 存储有一个复杂的问题
- javascript - 如何在鼠标按下时仅更改一次颜色(停止循环)?
- macos - 在 QT Creator 构建期间未创建 Moc 文件
- c++ - C ++在映射内创建函数指针向量
- google-app-engine - 我可以在单个 appengine 项目中混合编程语言吗?
- linux - 如何在 shell 中使用函数编写这个
- laravel - 将外键存储为零而不是它的值