Vincent_pm_dog 2021-01-30 18:46 采纳率: 0%
浏览 862

macos python 安装numpy报错

具体报错:

ERROR: Command errored out with exit status 1:

   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-y76_819o/numpy/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-y76_819o/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all

       cwd: /private/tmp/pip-install-y76_819o/numpy

  Complete output (10 lines):

  Running from numpy source directory.

  

  `setup.py clean` is not supported, use one of the following instead:

  

    - `git clean -xdf` (cleans all files)

    - `git clean -Xdf` (cleans all versioned files, doesn't touch

                        files that aren't checked into the git repo)

  

  Add `--force` to your command to use it anyway if you must (unsupported).

  

  ----------------------------------------

  ERROR: Failed cleaning build dir for numpy

Failed to build numpy

ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly

WARNING: You are using pip version 19.2.3, however version 21.0 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-07-24 13:35
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    要解决这个问题,首先确保你的系统已经安装了Python和相应的库。如果你使用的是Mac OS,你可以按照以下步骤操作:

    1. 打开终端。
    2. 输入以下命令并按回车键:
    sudo pip install --upgrade pip
    

    这将升级Python的版本。

    1. 然后输入以下命令来安装所需的包:
    python setup.py install
    

    如果在运行这些命令时遇到错误,请检查是否有任何依赖项未正确安装或更新。

    注意:如果在安装过程中遇到任何问题,可以参考Python官方文档(https://docs.python.org/3/install.html)以获取更详细的帮助。

    评论

报告相同问题?