ubuntu 20.04安装python-igraph

在Ubuntu系统中尝试安装python-igraph时遇到错误,首先因找不到C内核和网络问题导致安装失败。接着尝试使用pip2安装,但因Python版本过低而报错。最终成功的方法是先通过sudoapt-getinstalllibigraph0-dev安装C库,然后使用pip2安装python-igraph=0.7.1.post6。
摘要由CSDN通过智能技术生成

一、尝试一

直接sudo pip2 install python-igraph==0.7.1.post6

报错如下,显示找不到C内核,并且尝试下载也失败了

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1.post6
We will also try: 0.7.1

Version 0.7.1.post6 of the C core of igraph is not found among the nightly builds.

Use the --c-core-version switch to try a different version.
Could not download and compile the C core of igraph.

 二、尝试二

参照这篇文章进行安装,但是我方法一和方法二都不成功

 (1条消息) Ubuntu上igraph的安装教程_ubuntu igraph_DilicelSten的博客-CSDN博客

显示time-out 

三、尝试三  

sudo pip2 install python-igraph

尝试下载最新的,报错如下,原因就是python版本过低,2.7

Collecting python-igraph
  Downloading https://files.pythonhosted.org/packages/8c/96/0c027d017a334d22237ef29263d314724bd0f345e8ff122e4133c85cec91/python-igraph-0.9.6.tar.gz (3.6MB)
    100% |████████████████████████████████| 3.6MB 13kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-cPPJHC/python-igraph/setup.py", line 465
        raise RuntimeError(f"Failed to clean {folder} with git")
                                                              ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cPPJHC/python-igraph/
You are using pip version 9.0.1, however version 23.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

 

四、尝试四(安装成功)

sudo apt-get install -y libigraph0-dev

pip2 install python-igraph==0.7.1.post6

 记得一定要sudo

 参考:

(1条消息) python-igraph安装失败的解决方案_涛涛ALG的博客-CSDN博客

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ad_m1n

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值