> 文章列表 > ubuntu 20.04安装python-igraph

ubuntu 20.04安装python-igraph

ubuntu 20.04安装python-igraph

一、尝试一

直接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.1Version 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-igraphDownloading 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 465raise 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博客