导入igraph python时遇到问题

导入igraph python时遇到问题,python,installation,conda,Python,Installation,Conda,我的系统上有CentOS 6.8最终版。我已经安装了igrph python 当我尝试导入软件包时,出现以下错误: ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/abolfazl/.python-eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so) 我搜索了类似的问题,找到了一些答

我的系统上有CentOS 6.8最终版。我已经安装了igrph python

当我尝试导入软件包时,出现以下错误:

ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/abolfazl/.python-eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so)
我搜索了类似的问题,找到了一些答案。我试过了。 但我还是感到恐惧。 你有什么解决办法吗? 非常感谢

TL;博士:

conda install -yc nehaljwani python-igraph=0.7.1.post6
好的,让我们看看共享库存在哪些版本依赖项:

readelf --version-info /root/.cache/Python-Eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so | grep -Po '(?<=GLIBC_)([\d.]*)' | sort -Vr | head -1
2.14

readelf --version-info /root/.cache/Python-Eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so | grep -Po '(?<=GLIBCXX_)([\d.]*)' | sort -Vr | head -1
3.4.15
这里请注意,我使用了来自conda的gcc,并且我必须设置LD_LIBRARY_PATH,以便在测试包时,它将选择$conda_PREFIX/lib/libstdc++.so而不是系统的libstdc++.so。因此,下次使用自己构建的包时,也必须使用conda安装gcc。嗯,工作太多了

备选方案2:构建包,但使用系统的gcc和libxml2

yum install -y gcc-c++ libxml2-devel
bash Miniconda2-4.2.12-Linux-x86_64.sh -b -p ~/m2
source ~/m2/bin/activate
conda install -y conda-build
conda install -yc marufr python-igraph=0.7.1.post6
conda build $CONDA_PREFIX/pkgs/python-igraph-0.7.1.post6-py27_0/info/recipe/
conda remove -y python-igraph
conda install $CONDA_PREFIX/conda-bld/linux-64/python-igraph-0.7.1.post6-py27_0.tar.bz2
python -c 'import igraph; print igraph.__version__'
0.7.1
请注意,这一次,我不必导出LD_LIBRARY_PATH,也不必依赖于旧的系统库。现在,您不需要每次使用此软件包时都使用conda安装gcc。但还是太多的工作了,嗯

备选案文3。让pip编译共享库:_igraph.so

备选方案4:我已经为您构建了软件包,并将其放在我的频道上。请随意使用它:-

bash Miniconda2-4.2.12-Linux-x86_64.sh -b -p ~/m2
source ~/m2/bin/activate
conda install -yc nehaljwani python-igraph=0.7.1.post6
python -c 'import igraph; print igraph.__version__'
0.7.1
到目前为止,备选方案4是最简单的,但为什么它能起作用呢?现在让我们看看它的依赖关系:

readelf --version-info /root/.cache/Python-Eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so | grep -Po '(?<=GLIBCXX_)([\d.]*)' | sort -Vr | head -1
3.4

readelf --version-info /root/.cache/Python-Eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so | grep -Po '(?<=GLIBC_)([\d.]*)' | sort -Vr | head -1
2.7

如您所见,3.4是<3.4.15,2.7是<2.12,因此是共享库_igraph。因此现在加载系统的旧库:-

优秀。非常感谢。
yum install -y gcc-c++ libxml2-devel
bash Miniconda2-4.2.12-Linux-x86_64.sh -b -p ~/m2
source ~/m2/bin/activate
conda install -y conda-build
conda install -yc marufr python-igraph=0.7.1.post6
conda build $CONDA_PREFIX/pkgs/python-igraph-0.7.1.post6-py27_0/info/recipe/
conda remove -y python-igraph
conda install $CONDA_PREFIX/conda-bld/linux-64/python-igraph-0.7.1.post6-py27_0.tar.bz2
python -c 'import igraph; print igraph.__version__'
0.7.1
yum install -y gcc-c++ libxml2-devel
bash Miniconda2-4.2.12-Linux-x86_64.sh -b -p ~/m2
source ~/m2/bin/activate
pip install python-igraph==0.7.1.post6
python -c 'import igraph; print igraph.__version__'
0.7.1
bash Miniconda2-4.2.12-Linux-x86_64.sh -b -p ~/m2
source ~/m2/bin/activate
conda install -yc nehaljwani python-igraph=0.7.1.post6
python -c 'import igraph; print igraph.__version__'
0.7.1
readelf --version-info /root/.cache/Python-Eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so | grep -Po '(?<=GLIBCXX_)([\d.]*)' | sort -Vr | head -1
3.4

readelf --version-info /root/.cache/Python-Eggs/python_igraph-0.7.1.post6-py2.7-linux-x86_64.egg-tmp/igraph/_igraph.so | grep -Po '(?<=GLIBC_)([\d.]*)' | sort -Vr | head -1
2.7