【问题标题】:Installing package using Pip install on MacOS 10.15在 MacOS 10.15 上使用 Pip install 安装包
【发布时间】:2019-10-09 00:38:00
【问题描述】:

使用 Python3.7.3、MacOS 10.15

无法安装包 - 羽毛 试过 pip3 安装羽毛

返回错误:

ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/setup.py'"'"'; __file__='"'"'/private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/
    Complete output (31 lines):
    Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
    Traceback (most recent call last):
      File "/private/var/folders/vl/pzz3tlxx6_d5p38wth_1nnwr0000gn/T/pip-install-3p9h1fgs/feather/distribute_setup.py", line 143, in use_setuptools
        raise ImportError
    ImportError

错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出。

我要做的就是避免在 spyder 中出现这个错误

ModuleNotFoundError: 没有名为“羽毛”的模块

谁能帮我解释一下为什么我会遇到这样的问题

【问题讨论】:

  • 您的错误信息还有更多内容吗?例如。 “在处理上述异常期间,发生了另一个异常”?
  • 如果您能回答问题会很好,否则可能很难查明您的问题
  • 感谢您的帮助,我正在运行版本 setuptools (41.0.1),不知何故我解决了这个问题,我刚刚重新安装了所有软件包,它现在可以工作了

标签: python-3.x pip installation macos-catalina


【解决方案1】:

似乎缺少 setuptools。 试试pip3 install setuptools

这是报告错误的地方。

            # Setuptools 0.7b and later is a suitable (and preferable)
            # substitute for any Distribute version.
            try:
                pkg_resources.require("setuptools>=0.7b")
                return
            except (pkg_resources.DistributionNotFound,
                    pkg_resources.VersionConflict):
                pass

            if not hasattr(pkg_resources, '_distribute'):
                if not no_fake:
                    _fake_setuptools()
                raise ImportError

setuptools 的版本号是多少?

【讨论】:

  • 已满足要求:/usr/local/lib/python3.7/site-packages (41.0.1) 中的 setuptools
  • setuptools的版本号是多少?
  • 运行 41.0.1 版的 setuptools