无法安装 mysql-connector

无法安装 mysql-connector

我尝试安装 mysql-connector,但没有成功

 pip install mysql-connector-python-rf
Collecting mysql-connector-python-rf
  Downloading mysql-connector-python-rf-2.2.2.tar.gz (11.9MB)
    100% |████████████████████████████████| 11.9MB 33kB/s 
Installing collected packages: mysql-connector-python-rf
  Running setup.py install for mysql-connector-python-rf ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wnoa38/mysql-connector-python-rf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Y29xbt-record/install-record.txt --single-version-externally-managed --compile:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

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

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wnoa38/mysql-connector-python-rf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Y29xbt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Wnoa38/mysql-connector-python-rf/

你知道问题是什么吗?

答案1

尝试安装 2.1.6 版本。对我来说效果很好。

命令:

pip install mysql-connector==2.1.6

MySQL.com 上的此错误报告

相关内容