在开发Django应用程序时,我使用了以下命令来安装MySQL (python3):
(Venv)$ pip3 install mysql-connector-python --allow-external mysql-connector-python安装成功,pip3 freeze > requirements.txt显示mysql-connector-python==2.0.1已安装。
但是,在生产环境中,pip3 install -r requirements.txt生成了以下错误消息。
Downloading/unpacking mysql-connector-python==2.0.1 (from -r requirements.txt (line 6))
Could not find any downloads that satisfy the requirement mysql-connector-python==2.0.1 (from -r requirements.txt (line 6))这是一个bug吗?
发布于 2016-01-13 17:52:31
它在PIP上的打包方式有一个突出的缺陷。以下是详细信息:http://bugs.mysql.com/bug.php?id=76063
您可以使用以下命令安装mysql-connector,如同一链接中所述:
wget https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.3.zip
unzip mysql-connector-python-2.0.3.zip
cd mysql-connector-python-2.0.3
python setup.py install发布于 2016-01-12 01:56:23
pip无法安装mysql-python-connector,因为它的包维护者出现错误。Here is the relevant issue filed against that package's bug tracker.,尽管从技术上讲,它应该可以用
pip install --allow-external mysql-connector-python --allow-unverified mysql-connector-python mysql-connector-python
如果包维护者无法correctly register the external URLs to PyPI,这将不起作用。
请注意,作为实现Python DB API2.0规范的纯Python MySQL驱动程序,PyMySQL似乎是一个完全的临时替代品。此外,PyMySQL似乎得到了积极的维护、上传到PyPI (而不是托管在外部URL上),并且遵循更宽松的麻省理工学院许可(而不是GPLv2许可)。
发布于 2016-06-23 16:28:30
如果您不想手动安装,请尝试以下操作:
sudo pip3 install --extra-index-url https://pypi.python.org/pypi/mysql-connector-python/2.0.4 mysql-connector-python
在Debian Jessie上对我很有效。
https://stackoverflow.com/questions/27394426
复制相似问题