无法安装MySQL-Connector库

时间:2019-04-01 11:02:50

标签: mysql python-3.x pip

我正在使用mysql-connector 2.1.8一段时间,突然之间,它不再可用。

Could not find a version that satisfies the requirement mysql-connector==2.1.8 (from versions: 2.2.8)

我尝试安装一些较新的版本,例如2.2.5。从字面上工作一次,然后不在服务器上。

最新版本2.2.8给出了这样的错误:

Collecting mysql-connector==2.2.8
  Using cached https://files.pythonhosted.org/packages/8e/78/049f747325ce0154263cd1b10fe7ea9ddb17e839111c6f8f824d5964cfb5/mysql-connector-2.2.8.tar.gz
Installing collected packages: mysql-connector
  Running setup.py install for mysql-connector ... error
    Complete output from command /home/liudas/PycharmProjects/eneba_what_place/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7rlbpvfn/mysql-connector/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-record-kbw8r138/install-record.txt --single-version-externally-managed --compile --install-headers /home/liudas/PycharmProjects/eneba_what_place/venv/include/site/python3.6/mysql-connector:
    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

1 个答案:

答案 0 :(得分:1)

pip install -U setuptools wheel

较新的软件包版本可能需要setuptools或wheel的较新功能,因此这是--single-version-externally-managed not recognized的原因 使此类核心软件包保持最新是一件好事,而且它们几乎始终向后兼容。