尝试在2.7环境中pip安装MySQLpython

2024-10-03 23:26:48 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试使用pip安装MySQL python时,我得到以下错误。在

Oreos-MacBook-Pro:~ oreosmoreo$ pip install mysql-python
Collecting mysql-python
/Users/oreosmoreo/.pyenv/versions/2.7/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:369: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
/Users/oreosmoreo/.pyenv/versions/2.7/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
  Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/6k/gq07lqd9613313s4s5yyn64w0000gn/T/pip-install-H992H_/mysql-python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 53, in get_config
        libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ]
      File "setup_posix.py", line 8, in dequote
        if s[0] in "\"'" and s[0] == s[-1]:
    IndexError: string index out of range

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6k/gq07lqd9613313s4s5yyn64w0000gn/T/pip-install-H992H_/mysql-python/

我做过研究,但没有一个能为别人解决问题的方法适合我。我已经将我的setuptools和pip更新为当前版本。在


Tags: installpiptoinpysslpackagessetup