【问题标题】:Error installing MySQL-Python on Mac在 Mac 上安装 MySQL-Python 时出错
【发布时间】:2013-05-10 02:24:56
【问题描述】:

我尝试安装 MySQL-Python 库以使用 Django 进行开发,但总是以不同的方式显示任何错误:

使用 PIP:

rigo:~ rigobcastro$ sudo pip install MySQL-Python
Downloading/unpacking MySQL-Python
  Could not fetch URL https://pypi.python.org/simple/MySQL-Python/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:503: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
  Will skip URL https://pypi.python.org/simple/MySQL-Python/ when looking for download links for MySQL-Python
  Could not fetch URL https://pypi.python.org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:503: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
  Will skip URL https://pypi.python.org/simple/ when looking for download links for MySQL-Python
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/MySQL-Python/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:503: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
  Will skip URL https://pypi.python.org/simple/MySQL-Python/ when looking for download links for MySQL-Python
  Could not find any downloads that satisfy the requirement MySQL-Python
No distributions at all found for MySQL-Python
Storing complete log in /Users/rigobcastro/.pip/pip.log

使用 easy_install:

rigo:~ rigobcastro$ sudo easy_install MySQL-Python
Searching for MySQL-Python
Reading http://pypi.python.org/simple/MySQL-Python/
Reading http://sourceforge.net/projects/mysql-python
Reading https://github.com/farcepest/MySQLdb1
Best match: MySQL-python 1.2.4
Downloading http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.4.zip#md5=ddf2386daf10a97af115ffad2ed4a9a0
Processing MySQL-python-1.2.4.zip
Running MySQL-python-1.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-mx6sxJ/MySQL-python-1.2.4/egg-dist-tmp-XMcHdk
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/easy_install-mx6sxJ/MySQL-python-1.2.4/temp/tmp9GMCmz
Now working in /tmp/easy_install-mx6sxJ/MySQL-python-1.2.4/temp/tmp9GMCmz/distribute-0.6.28
Building a Distribute egg in /private/tmp/easy_install-mx6sxJ/MySQL-python-1.2.4
/private/tmp/easy_install-mx6sxJ/MySQL-python-1.2.4/distribute-0.6.28-py2.6.egg
cc1: error: unrecognized command line option "-Wno-null-conversion"
error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1
rigo:~ rigobcastro$ 

由于 llvm-gcc-4.2 错误,我尝试安装 XCode 及其命令行工具和 GCC 解决方案。

我有 Python 2.7.4 和 Mac OSX Lion 10.7.5。

【问题讨论】:

  • pip 应该是pip install mysql-python
  • @Hedde 这个错误不适用于 Camelcase pasteboard.co/2rRlUXiL.png 无论如何谢谢

标签: python macos mysql-python easy-install


【解决方案1】:

正如我之前提到的其他人......让 Python 在 Mac 上与 MySQL 一起工作是一个 ?@#$@&%^!!噩梦。

最初从原始 Django 网站在 Mac OS 10.7.5 上安装 Django 框架,当 MySQLdb 不起作用时,经过数小时的谷歌搜索和尝试 SO 的解决方案后,我已经从 BitNami http://bitnami.com/stack/django 安装了 Django 堆栈/p>

不过,遇到了上面提到的问题,然后还有一些问题......

最终帮助我的是 Josh 在他的博客上推荐的内容: http://joshbranchaud.com/blog/2013/02/10/Errors-While-Setting-Up-Django.html

现在 Python 2.7 终于连接到 MySQL 5.5

【讨论】:

    【解决方案2】:

    这似乎是与 SSL 相关的问题。 在这里你可以找到解释。 https://github.com/pypa/pip/issues/829

    【讨论】:

      猜你喜欢
      • 2011-01-25
      • 2015-10-30
      • 2013-07-10
      • 2015-04-16
      • 1970-01-01
      • 2019-04-27
      • 2019-10-13
      • 2014-12-01
      • 2018-09-10
      相关资源
      最近更新 更多