安装python-igraph时出现UnicodeDecodeError [英] UnicodeDecodeError when installing python-igraph

查看:87
本文介绍了安装python-igraph时出现UnicodeDecodeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在64位Linux Mint 16上使用python 2.7,并且试图安装python-igraph.但是,当我运行sudo pip install python-igraph时,会得到以下日志:

I'm using python 2.7 on 64-bit Linux Mint 16 and I'm trying to install python-igraph. But when I run sudo pip install python-igraph I get the following log:

Downloading/unpacking python-igraph
  Downloading python-igraph-0.7.1-1.tar.gz (375kB): 375kB downloaded
  Running setup.py egg_info for package python-igraph

Installing collected packages: python-igraph
  Running setup.py install for python-igraph
    Build type: dynamic extension
    Include path: /usr/include/igraph
    Library path:
    Linked dynamic libraries: igraph
    Linked static libraries:
    Extra compiler options:
    Extra linker options:
    building 'igraph._igraph' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/igraphmodule.c -o build/temp.linux-x86_64-2.7/src/igraphmodule.o
    In file included from src/igraphmodule.c:30:0:
    src/convert.h:65:59: error: unknown type name ‘igraph_pagerank_algo_t’
     int igraphmodule_PyObject_to_pagerank_algo_t(PyObject *o, igraph_pagerank_algo_t *result);
                                                               ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-akm3_O-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/igraph

copying igraph/formula.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/__init__.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/configuration.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/summary.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/layout.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/cut.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/datatypes.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/utils.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/clustering.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/statistics.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/matching.py -> build/lib.linux-x86_64-2.7/igraph

copying igraph/compat.py -> build/lib.linux-x86_64-2.7/igraph

creating build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/operators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/isomorphism.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/__init__.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/colortests.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/conversion.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/homepage.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/attributes.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/vertexseq.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/structural.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/separators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/atlas.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/layouts.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/rng.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/games.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/utils.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/iterators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/edgeseq.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/indexing.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/spectral.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/cliques.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/flow.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/basic.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/generators.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/matching.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/foreign.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/bipartite.py -> build/lib.linux-x86_64-2.7/igraph/test

copying igraph/test/decomposition.py -> build/lib.linux-x86_64-2.7/igraph/test

creating build/lib.linux-x86_64-2.7/igraph/app

copying igraph/app/__init__.py -> build/lib.linux-x86_64-2.7/igraph/app

copying igraph/app/shell.py -> build/lib.linux-x86_64-2.7/igraph/app

creating build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/__init__.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/edge.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/shapes.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/coord.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/metamagic.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/utils.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/text.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/graph.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/colors.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/vertex.py -> build/lib.linux-x86_64-2.7/igraph/drawing

copying igraph/drawing/baseclasses.py -> build/lib.linux-x86_64-2.7/igraph/drawing

creating build/lib.linux-x86_64-2.7/igraph/remote

copying igraph/remote/__init__.py -> build/lib.linux-x86_64-2.7/igraph/remote

copying igraph/remote/nexus.py -> build/lib.linux-x86_64-2.7/igraph/remote

copying igraph/remote/gephi.py -> build/lib.linux-x86_64-2.7/igraph/remote

creating build/lib.linux-x86_64-2.7/igraph/vendor

copying igraph/vendor/__init__.py -> build/lib.linux-x86_64-2.7/igraph/vendor

copying igraph/vendor/texttable.py -> build/lib.linux-x86_64-2.7/igraph/vendor

running build_ext

Build type: dynamic extension

Include path: /usr/include/igraph

Library path:

Linked dynamic libraries: igraph

Linked static libraries:

Extra compiler options:

Extra linker options:

building 'igraph._igraph' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/src

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/igraph -I../../build/include -I../../include -I/usr/local/include/igraph -I/usr/include/igraph -I/usr/include/python2.7 -c src/igraphmodule.c -o build/temp.linux-x86_64-2.7/src/igraphmodule.o

In file included from src/igraphmodule.c:30:0:

src/convert.h:65:59: error: unknown type name ‘igraph_pagerank_algo_t’

 int igraphmodule_PyObject_to_pagerank_algo_t(PyObject *o, igraph_pagerank_algo_t *result);

                                                           ^

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip_build_root/python-igraph/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-akm3_O-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip_build_root/python-igraph
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 148, in main
    return command.main(args[1:], options)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 169, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 50: ordinal not in range(128)

我以前安装过libigraph0-dev.在这种情况下,如何安装python-igraph?

I previously installed libigraph0-dev. How can I install python-igraph in this case?

推荐答案

libigraph0-dev的版本是否与Python接口的版本号匹配?如果libigraph0-dev的版本不等于0.7.1,则它不适用于您要编译的python-igraph的版本.在这种情况下,最好删除libigraph0libigraph0-dev并再次运行pip install python-igraph.然后,安装脚本将尝试首先下载并编译igraph的C内核的适当版本.

Does the version of libigraph0-dev match the version number of the Python interface? If the version of libigraph0-dev is not equal to 0.7.1, it will not be suitable for the version of python-igraph that you are trying to compile. In that case, it is better to remove libigraph0 and libigraph0-dev and run pip install python-igraph again; the setup script will then attempt to download and compile an appropriate version of the C core of igraph first.

我知道您今天发布了另一个问题,其中您说pip install python-igraph(没有libigraph0-dev)对您不起作用;无论如何请重试,因为python-igraph的先前版本存在一个错误,导致该错误阻止其下载正确版本的C内核,而我已在一个小时前修复了该错误.

I know that you have posted another question today in which you stated that pip install python-igraph (without having libigraph0-dev) does not work for you; try again anyway because the previous version of python-igraph had a bug that prevented it from downloading the right version of the C core, and I have fixed the bug just an hour ago.

这篇关于安装python-igraph时出现UnicodeDecodeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆