Error: Command errored out with exit status 1: (really long command)

Error: Command errored out with exit status 1: (really long command)


$ cd surface_dynamics
$ pip3 install .
Processing /Users/jacobelection/surface_dynamics
ERROR: Command errored out with exit status 1:
     command: /usr/local/Caskroom/miniconda/base/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py'"'"'; __file__='"'"'/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/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 /private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-pip-egg-info-jhapggrl
         cwd: /private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/
    Complete output (15 lines):
    Traceback (most recent call last):
      File "/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py", line 9, in <module>
        import sage.all
    ModuleNotFoundError: No module named 'sage'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/m8/lmzlkfq11wj3rn17q7xm7g2m0000gn/T/pip-req-build-ubkp2yci/setup.py", line 11, in <module>
        raise ValueError("this package currently installs only inside SageMath (http://www.sagemath.org)\n"
    ValueError: this package currently installs only inside SageMath (http://www.sagemath.org)
    If you are using Ubuntu with Sage installed from the official apt repository, run
    first in a console "$ source /usr/share/sagemath/bin/sage-env"

    ----------------------------------------
WARNING: Discarding file:///Users/jacobelection/surface_dynamics. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我该如何解决这些问题?我的 python 版本是 3.8.3。 macOS Big Sur 11.1

命令需要 运行 和 pip 对应于 SageMath 的 Python,这将 取决于 SageMath 的安装方式:

  • 从源代码构建?
  • 来自 SageMath 下载页面的二进制文件?
  • 来自 Marc Culler 的 SageMath 应用?
  • 通过自制酒桶?
  • 通过康达?

一种方法是从

安装 SageMath macOS 应用程序

和 运行 Recommended.pkg 安装程序。

然后代替

pip3 install .

运行

sage --pip install .

或者,如果您通过 Conda 安装了 SageMath,请确保 首先激活对应的Conda环境:

conda activate sage
pip install .

如有疑问,请检查将要调用的 pip 使用如下命令:

which pip
ls -halF $(which pip)
which pip3
ls -halF $(which pip3)