Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.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 3.5.1安装mysql连接器?_Python_Mysql_Pip_Version_Connector - Fatal编程技术网

如何为python 3.5.1安装mysql连接器?

如何为python 3.5.1安装mysql连接器?,python,mysql,pip,version,connector,Python,Mysql,Pip,Version,Connector,我使用的是python 3.5.1,在安装mysql连接器时遇到问题: install --allow-external mysql-connector-python-rf mysql-connector-python-rf 不起作用,mysql连接器python rf的正常pip命令也不起作用。我得到以下信息: error: option --single-version-externally-managed not recognized 有什么想法吗?到目前为止,对于python 3.5

我使用的是python 3.5.1,在安装mysql连接器时遇到问题:

install --allow-external mysql-connector-python-rf mysql-connector-python-rf
不起作用,mysql连接器python rf的正常pip命令也不起作用。我得到以下信息:

error: option --single-version-externally-managed not recognized

有什么想法吗?

到目前为止,对于
python 3.5.1
还没有
mysql连接器,但是您可以使用pymysql将mysql连接到python 3.5.1

import pymysql

conn = pymysql.connect(host='localhost', port=port_no, user='db_user', passwd='password', db='db_name')

也许,这可以解决这个问题:我在那篇文章中使用了--egg解决方案,它成功了,谢谢。