在Ubuntu 14.04上为python3安装graphviz时遇到问题 [英] Trouble installing graphviz for python3 on ubuntu 14.04

查看:395
本文介绍了在Ubuntu 14.04上为python3安装graphviz时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用python3绘制决策树。但是我只能找到python2的模块: graphviz ete3
我错过了什么吗?我可以将它们与python3一起使用吗?您知道其他可能性吗?

I want to draw a decision tree with python3. Yet I can only find modules for python2: graphviz, ete3 Did I miss something? Can I use them with python3? Do you know any other possibilities?

我使用Ubuntu 14.04。

I use Ubuntu 14.04.

编辑:

我尝试了命令 sudo python3 -m pip install graphviz ,但仍然找不到该模块。

I tried the command sudo python3 -m pip install graphviz, but it still can't find the module.

推荐答案

根据 Graphviz的PyPI页面,可用于Python 3。

According to Graphviz's PyPI page, it is available for Python 3.

在Ubuntu上,请确保您具有带有以下内容的graphviz:

On Ubuntu make sure you have graphviz with:

sudo apt-get install python3-pygraphviz

也许Python3找不到您安装的graphviz?您是否安装了例如

Perhaps Python3 can't find your installed graphviz? Did you install it with, e.g.

python3 -m pip install graphviz

在Ubuntu上,您可以尝试:

On Ubuntu you might try:

sudo apt-get install python3-pip
pip3 install graphviz

您尚未告诉我们您的系统是什么,这可能会影响您的建议给出。

You haven't told us what your system is, which may affect the advice you are given.

如果您使用的是Windows,我通常建议安装Anaconda并使用其软件包管理器(它附带了几乎所有东西,但没有graphviz,因此您必须使用它的软件包管理器进行安装,但是我希望一旦安装完成,它就可以正常工作了。

If you're on Windows, I usually recommend installing Anaconda and using its package manager (it comes with almost all the things, but not graphviz so you'd have to use its package manager to install, but I'd expect it to work out of the gate once you did install it).

如果您使用的是Mac或Linux,请尝试使用上面提供的命令(或您的Python 3可执行文件使用的任何命令)进行安装。

If you're on Mac or Linux, try installing with the command I gave above (or whatever your Python 3 executable uses.)

这篇关于在Ubuntu 14.04上为python3安装graphviz时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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