适用于Django 1.9和Python 3.5的Python连接器? [英] Python Connector for Django 1.9 and Python 3.5?

查看:89
本文介绍了适用于Django 1.9和Python 3.5的Python连接器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截至该问题发布之日止,我正在使用最新版本的Python和Django,但找不到适用于支持Python 3.5的MySQL的连接器.有人有解决这个问题的办法吗?我在Windows平台上运行.

I'm working with the latest version of Python and Django as of the date of this question and I cannot find a connector that will work for MySQL which supports Python 3.5. Does anybody have a solution to this problem? I'm running on a Windows platform.

当我尝试从此处此处下载mysqlclient时,我正在运行Python 3.5 Windows 8.1上的.1 32.我下载了车轮,尝试使用pip安装车轮文件,出现了

When I try to download the mysqlclient from here here, I'm running Python 3.5.1 32 on Windows 8.1. I download the wheel, I attempt to install the wheel file using pip, I get the error that

mysqlclient-1.3.7-cp27-none-win32.whl在此上不受支持 平台.

mysqlclient-1.3.7-cp27-none-win32.whl is not a supported wheel on this platform.

显然,这个轮子应该可以在Python 3.5上运行.

Apparently this wheel is supposed to work on Python 3.5.

为了确保我在其他地方没有问题,因为我是这种whl格式的新手,所以我下载了另一个软件包(BeautifulSoup4)并确认该wheel文件的安装正常,因此看来是有问题的与我的操作系统和mysqlclient的wheel文件一起使用.

To make sure I'm not having a problem elsewhere, since I'm new to this whl format, I downloaded another package (BeautifulSoup4) and confirmed the installation of that wheel file is working, so it appears to be a problem with my operating system and the wheel file for mysqlclient.

推荐答案

cgohlke 所述, mysqlclient可以目前尚未在Windows的Python 3.5上进行编译,因为MySQL Connector/C与Python 3.5所需的Visual Studio 2015编译器尚不兼容.

关注相关的GitHub问题: mysqlclient-python-不适用于python 3.5 要知道何时会修复此错误.

Follow the related GitHub issue : mysqlclient-python - Not working with python 3.5 to be aware when this bug will be fixed.

在解决此问题后, mysqlclient 应该可以工作.

When this issue will be fixed, mysqlclient should work.

具有非官方Windows二进制文件的临时解决方案: mysqlclient-1.3.7

Temporary solution with unofficial Windows binaries : mysqlclient-1.3.7

来自 Django 1.9文档:

Django支持MySQL 5.5和更高版本.

Django supports MySQL 5.5 and higher.

Django需要mysqlclient 1.3.3或更高版本.请注意,不支持Python 3.2.除了对Python 3.3+的支持外,mysqlclient的行为应与MySQLDB大致相同.

Django requires mysqlclient 1.3.3 or later. Note that Python 3.2 is not supported. Except for the Python 3.3+ support, mysqlclient should mostly behave the same as MySQLDB.

来自 mysqlclient 1.3.7包索引:

From mysqlclient 1.3.7 package index :

mysqlclient是MySQL-python的分支.它增加了对Python 3.3〜的支持,并合并了一些拉取请求.

mysqlclient is a fork of MySQL-python. It adds Python 3.3~ support and merges some pull requests.

当前支持MySQL-4.1至5.5和Python-2.7、3.3-3.5.支持PyPy.

MySQL-4.1 through 5.5 and Python-2.7, 3.3-3.5 are currently supported. PyPy is supported.

这篇关于适用于Django 1.9和Python 3.5的Python连接器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆