首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装mahotas,并且安装python无法修复错误。

无法安装mahotas,并且安装python无法修复错误。
EN

Stack Overflow用户
提问于 2016-06-13 12:12:42
回答 2查看 1.3K关注 0票数 0

我正在编写一本教科书,其中一个例子是python所需的mahotas。我立即尝试用pip安装它,并立即得到以下错误:

代码语言:javascript
复制
 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,我得到了以下内容:

代码语言:javascript
复制
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.   

当我试着安装它的时候?

答:

代码语言:javascript
复制
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.

然后:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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.

这是个兔子洞。我怎么才能逃脱?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-06-14 08:01:51

(本文作者为mahotas )。

您的Ubuntu安装现在处于某种奇怪的状态,wrt是Python包。我建议离开兔子洞的建议是使用Anaconda:https://www.continuum.io/why-anaconda

然后,您可以从conda-forge项目获得mahotas:https://anaconda.org/conda-forge/mahotas

康达锻造是一个社区项目,将保持它的最新。Anaconda还有其他优势。

票数 1
EN

Stack Overflow用户

发布于 2018-11-13 09:36:50

如果已经安装了Anaconda,可以在命令行中输入以下代码:

代码语言:javascript
复制
conda install -c conda-forge mahotas

对我来说很管用

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37789572

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档