无法使用C标志安装mysql-connector-python

时间:2017-09-11 10:31:14

标签: python mysql pip

在我的虚拟环境中,我运行的是:

pip install --install-option="--with-mysql-capi=/usr/bin/mysql_config" https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.6.tar.gz

我收到错误:

    Collecting https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.6.tar.gz
  Using cached https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.6.tar.gz
Skipping bdist_wheel for mysql-connector-python, due to binaries being disabled for it.
Installing collected packages: mysql-connector-python
  Running setup.py install for mysql-connector-python ... error
    Complete output from command /home/sudheer/workspace/pvenvs/p2s/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-iDBnrD-build/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-cWuFBz-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sudheer/workspace/pvenvs/p2s/include/site/python2.7/mysql-connector-python --with-mysql-capi=/usr/bin/mysql_config:
    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 "/home/sudheer/workspace/pvenvs/p2s/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-iDBnrD-build/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-cWuFBz-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/sudheer/workspace/pvenvs/p2s/include/site/python2.7/mysql-connector-python --with-mysql-capi=/usr/bin/mysql_config" failed with error code 1 in /tmp/pip-iDBnrD-build/

我有最新的点子。 SO中几乎没有相关问题,但没有一个能解决这个问题。是否可以通过pip以这种方式安装mysql-connector-python?

0 个答案:

没有答案