ubuntu - 如何在 Google Colab 上安装 gmpy2?
问题描述
我正在尝试通过以下命令在Google Colab上安装“gmpy2” :
!pip3 install gmpy2
我得到错误:
Collecting gmpy2
Downloading gmpy2-2.0.8.zip (280 kB)
|████████████████████████████████| 280 kB 5.0 MB/s
Building wheels for collected packages: gmpy2
Building wheel for gmpy2 (setup.py) ... error
ERROR: Failed building wheel for gmpy2
Running setup.py clean for gmpy2
Failed to build gmpy2
Installing collected packages: gmpy2
Running setup.py install for gmpy2 ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vgotfc49/gmpy2_497ebb8b22424194b2bbd366af5942b6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vgotfc49/gmpy2_497ebb8b22424194b2bbd366af5942b6/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xvhw4sjx/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/gmpy2 Check the logs for full command output.
Google Colab 适用于描述:Ubuntu 18.04.5 LTS 代号:仿生模型名称:AMD EPYC 7B12
pip3 --version
pip 21.1.3 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)
为什么我不能安装“gmpy2”?此错误的原因可能是什么?
解决方案
以下是安装方法gmpy2
:
!apt install libmpc-dev
!pip install gmpy2
推荐阅读
- ios - 当状态更改导致键盘在工作表中辞去第一响应者时,SwiftUI iOS 应用程序崩溃
- python - 在 Python 中对 JSON 文件进行排序并输出为 Excel
- elasticsearch - 如何使用 java 高级 REST 客户端 Elasticsearch 获取嵌套聚合存储桶
- sql - 有没有办法根据 Max(date) 在 postgres 中获取组的第一行
- django - Django模型+两个表上的唯一列(继承)
- python - Django Rest Framework 结合了 2 个查询
- node.js - 我可以在 sequelize.js(Node js) 中删除多个删除吗
- javascript - 在循环的 BScard 中使用 getElementByClassName 获取输入类型的值
- python - 在我的 Python 函数中查找错误以绘制直方图并返回列表?
- php - 移动设备/平板电脑上的大菜单问题