python - 用anaconda2 pip安装python-igraph,找不到C核心。 Linux Fedora 24

标签 python linux anaconda fedora igraph

我想从 Anaconda 4.1.1 安装 igraph for python 2.7.12 我有 Fedora 24。按照建议(https://anaconda.org/pypi/python-igraph)我使用了这个命令行:

pip install -i https://pypi.anaconda.org/pypi/simple python-igraph

输出包括这些行:

[...]

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
  We will also try: 0.7.0

  Downloading igraph-0.7.0.tar.gz... 100.00%
  Extracting igraph-0.7.0.tar.gz...
  Configuring igraph...
  checking for a BSD-compatible install... /usr/bin/install -c
  checking whether build environment is sane... yes
  checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
  checking for gawk... gawk
  checking whether make sets $(MAKE)... yes
  checking whether make supports nested variables... yes
  checking for gcc... gcc
  checking whether the C compiler works... yes
  checking for C compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C compiler... yes
  checking whether gcc accepts -g... yes
  checking for gcc option to accept ISO C89... none needed
  checking whether gcc understands -c and -o together... yes
  checking for style of include used by make... GNU
  checking dependency style of gcc... gcc3
  checking for g++... no
  checking for c++... no
  checking for gpp... no
  checking for aCC... no
  checking for CC... no
  checking for cxx... no
  checking for cc++... no
  checking for cl.exe... no
  checking for FCC... no
  checking for KCC... no
  checking for RCC... no
  checking for xlC_r... no
  checking for xlC... no
  checking whether we are using the GNU C++ compiler... no
  checking whether g++ accepts -g... no
  checking dependency style of g++... none
  configure: error: no C++ compiler found or it cannot create executables
  Could not download and compile the C core of igraph.

[...]

In file included from src/vertexseqobject.c:26:0:
    src/attributes.h:27:31: fatal error: igraph_attributes.h: No such file or directory
     #include <igraph_attributes.h>
                                   ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/ritamaria/anaconda2/bin/python -u -c "import setuptools, tokenize;_

_file__='/tmp/pip-build-aKLm3d/python-igraph/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-32PKAO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-aKLm3d/python-igraph/

然而,当我检查我是否有 gcc 时,我得到:

dnf install gcc
Last metadata expiration check: 1:16:49 ago on Fri Jul 15 09:02:56 2016.
Package gcc-6.1.1-3.fc24.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

从 igraph 网页说:

if the C core is not installed or is installed in a location that cannot be detected using pkg-config, pip will attempt to download a matching version of the C core and compile it together with the Python interface.

所以我猜 pip 尝试下载 C 核心但不能/没有工作。

如何正确安装 python-igraph?

提前致谢。

最佳答案

软呢帽 24 ...

checking for g++... no

安装 g++ : # dnf install gcc-c++

igraph 库、igraph_attributes.h 等 headers.h :# dnf install igraph-devel(您获得版本 0.7.1)。

python 文件:

# pip install --upgrade pip
# pip install igraph

关于python - 用anaconda2 pip安装python-igraph,找不到C核心。 Linux Fedora 24,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38400162/

相关文章:

python - 在 MAC OS 或 Linux 中创建快捷方式链接文件或文件夹

linux - 是否可以对 pr 实用程序的页脚做些什么?

ruby-on-rails - Postgresql安装后出现错误

python - conda-env list/conda info --envs 如何查找环境?

python - IPython 控制台找不到 "backports.shutil_get_terminal_size"并且不会加载

使用 FileHandler 的 Pythonlogging.get_Logger(name) 不会写入文件

python - 在 XML 标签/文本中使用特殊字符

python - psycopg2 - 导入错误 : DLL load failed while importing _psycopg: The operating system cannot run %1

Python:优化内存中的图像(使用 jpegoptim 的 StringIO 和 POpen)

php - 使用 wget 的多个 cron 作业