【问题标题】:Pip installation is failing on MacMac 上的 Pip 安装失败
【发布时间】:2018-06-29 03:32:30
【问题描述】:

“sudo easy_install pip”失败并出现以下错误:

Traceback (most recent call last):
  File "/usr/bin/easy_install-2.7", line 11, in <module>
    load_entry_point('setuptools==18.5', 'console_scripts', 'easy_install')()
  File "/Users/swastika.singhal/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 572, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Users/swastika.singhal/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2755, in load_entry_point
    return ep.load()
  File "/Users/swastika.singhal/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2408, in load
    return self.resolve()
  File "/Users/swastika.singhal/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py", line 2414, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 46, in <module>
    from setuptools.archive_util import unpack_archive
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/archive_util.py", line 15, in <module>
    from pkg_resources import ensure_directory, ContextualZipFile
ImportError: cannot import name ContextualZipFile

到目前为止,Google 解决方案对我不起作用。

【问题讨论】:

标签: macos python-2.7


【解决方案1】:

这个 GitHub 问题帮助我修复了它:github.com/PyMySQL/mysqlclient-python/issues/169

具体来说:

mysql_config 中有如下几行:

# Create options 
libs="-L$pkglibdir"
libs="$libs -l "

我将它们编辑为:

# Create options 
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"

【讨论】:

  • 您能否简要说明您为解决问题所做的工作? StackOverflow 上没有很好地接受仅链接的答案。
猜你喜欢
  • 2020-09-16
  • 2021-04-28
  • 1970-01-01
  • 2019-11-24
  • 2014-09-07
  • 2018-10-23
  • 2020-07-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多