2016-06-13 165 views
0

我正在通过一本教科书,其中一个例子需要python的mahotas。我立即试图与PIP安装它,并立即得到这个错误:无法安装mahotas,并安装python-dev没有修复错误

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DPY_ARRAY_UNIQUE_SYMBOL=Mahotas_PyArray_API_Symbol -I/usr/local/lib/python3.4/dist-packages/numpy/core/include -I/usr/include/python3.4m -c mahotas/_convex.cpp -o build/temp.linux-x86_64-3.4/mahotas/_convex.o 
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] 
    In file included from mahotas/numpypp/array.hpp:17:0, 
        from mahotas/_convex.cpp:7: 
    mahotas/numpypp/numpy.hpp:10:20: fatal error: Python.h: No such file or directory 
    #include <Python.h> 
        ^
    compilation terminated. 
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

---------------------------------------- 
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-kzn3_c4k/mahotas/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y19bwul7-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-kzn3_c4k/mahotas/ 

现在,查找其他#include <Python.h>error: command 'x86_64-linux-gnu-gcc错误后,我一直斥骂安装python-dev。 不幸的是,马上失败,那么作为python-dev已经是最新版本,并python3-dev我得到这个:

The following packages have unmet dependencies: 
python3-dev : Depends: libpython3-dev (= 3.4.0-0ubuntu2) but it is not going to be installed 
      Depends: python3.4-dev (>= 3.4.0-0~) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

当我尝试安装那些?

答:

The following packages have unmet dependencies: 
libpython3-dev : Depends: libpython3.4-dev (>= 3.4.0-0~) but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 

然后:

The following packages have unmet dependencies: 
libpython3.4-dev : Depends: libpython3.4-stdlib (= 3.4.0-2ubuntu1) but 3.4.3-1ubuntu1~14.04.3 is to be installed 
        Depends: libpython3.4 (= 3.4.0-2ubuntu1) but 3.4.3-1ubuntu1~14.04.3 is to be installed 
E: Unable to correct problems, you have held broken packages. 

B:

The following packages have unmet dependencies: 
python3.4-dev : Depends: python3.4 (= 3.4.0-2ubuntu1) but 3.4.3-1ubuntu1~14.04.3 is to be installed 
       Depends: libpython3.4-dev (= 3.4.0-2ubuntu1) but it is not going to be installed 
       Depends: libpython3.4 (= 3.4.0-2ubuntu1) but 3.4.3-1ubuntu1~14.04.3 is to be installed 
E: Unable to correct problems, you have held broken packages. 

这是兔孔。我怎样才能逃脱?

回答

1

(作者mahotas在这里)。

您的Ubuntu安装现在处于Python-dev软件包的某种奇怪状态。我的建议得到了兔子洞的是使用Anaconda:https://www.continuum.io/why-anaconda

然后你可以从康达锻项目mahotas:https://anaconda.org/conda-forge/mahotas

康达锻是一个社区项目,这将使它保持最新。蟒蛇还有其他优点。

+0

叹......我害怕你会这样说。前段时间我安装了anaconda,但是我推迟使用它,所以我不会过度依赖。 – Rich

+0

有没有办法解决我的Python? – Rich

+0

编辑:我只是试图安装它,并一直给我'PermissionError:[Errno 13]权限被拒绝:'错误。 – Rich