python - 错误:命令出错,退出状态为 1:(非常长的命令)
问题描述
$ 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 大苏尔 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)
推荐阅读
- google-sheets - 基于列标题的 Google 电子表格查询计数
- android - 如何实现 API 调用以将数据从 Tizen Watch App 发送到 Companion App(iOS)
- python - Tkinter - 创建动态条目小部件
- c# - 投射文本框 KeyEventArgs
- sqlite - 移动应用程序的离线存储-数据传输到云-发布到应用程序商店。需要建议
- firebase - 如何在flutter中从云Firestore的许多用户帖子中获取最近的用户帖子?
- java - Hibernate JPA 更新多线程单实体
- python - 将 PyCharm 项目发送给某人
- python-3.x - 我收到 TensorFlow 错误“ValueError:不支持无值”。在尝试填充 tf 数据集时。有人可以帮助我吗?
- css - 用两个独立的滚动条分割屏幕