Windows10(64位)下快速安装 pygraphviz

news/2025/2/12 0:18:54/

Windows下并没有安装pygraphviz的快捷方式,使用
conda install -c anaconda pygraphviz
的命令方式只能在linux中。

如果你打开https://anaconda.org/anaconda/pygraphviz/files就发现,这里确实没有windows下可以使用的轮子。

Stackoverflow上的参考

在stackoverflow上有一个快速的安装方法,

https://stackoverflow.com/questions/40809758/howto-install-pygraphviz-on-windows-10-64bit

我列出原文如下,

It is a real pain to install pygraphviz on Windows 10 but this is the simples solution which works for me:

Step 1: Download and install Graphviz
https://graphviz.gitlab.io/_pages/Download/Download_windows.html

Step 2: Add below path to your PATH environment variable
C:\Program Files (x86)\Graphviz2.38\bin

Step 3: Re-open command line and activate venv in your project, example:
venv\Scripts\activate

Step 4: Download binaries from below link:
https://github.com/CristiFati/Prebuilt-Binaries/tree/master/PyGraphviz/v1.5/Graphviz-2.42.2

Step 5. Install whl into your virtual environment
For example:

In case of python 3.7
pip install pygraphviz-1.5-cp37-cp37m-win_amd64.whl

In case of python 3.8
pip install pygraphviz-1.5-cp38-cp38-win_amd64.whl

当然,每个人的系统不一样,按这个样子也未必能安装好,参考上面的提示,我按照自己的过程安装了一次就成功了!

实际简单的安装过程描述

1. 安装pydot等
conda install -c anaconda pydot

这些不多说了,是使用时发现缺少的包,你全部安装完,少了哪个再补哪个就行了。

2. 安装 graphviz

这一步,你即可以到
https://graphviz.gitlab.io/_pages/Download/Download_windows.html
下载graphviz-2.38.msi安装或graphviz-2.38.zip解压到特定文件夹,也可以使用
conda install -c anaconda graphviz
安装,本人嫌麻烦,使用的是
conda install -c anaconda 

安装好之后,找到那个graphviz的文件夹,把路径添加到path环境变量之中去,比如我的全路径是
D:\Anaconda3\pkgs\graphviz-2.38-hfd603c8_2\Library\bin\graphviz

这是因为,python在调用graphviz时,会用到很多命令,比如neato.exe,只要你能让python在环境路径中找到这些指令就可以了。

如果你在命令窗口中输入neato指令,系统提示说找不到,那八成是没有设置好路径。在python中使用时肯定也会报出相似的错误,比如"cannot find neato"之类的。

3。第三步,直接安装pygraphviz,

根据自己的python版本,到这里
https://github.com/CristiFati/Prebuilt-Binaries/tree/master/PyGraphviz/v1.5/Graphviz-2.42.2

把轮子下载下来,比如我用的python3.6,那就是

pip install pygraphviz-1.5-cp36-cp36m-win_amd64.whl

安装完之后,一般就可以正常使用了。

 

 


http://www.ppmy.cn/news/558801.html

相关文章

graphviz例子

window系统下得到一个目录下所有的文件list.txt: 然后输入:dir/b/on >list.txt 并按下回车键 /b  使用空格式(没有标题信息或摘要)。 /N  按名称(字母顺序) dir/b/n/on >list.txt 获取当前目录及子目录下所有文件名 dir /s/b *.* > l…

开源的图可视化工具——Graphviz

g r a p h v i z graphviz graphviz(Graph Visualization Software)是一个由 A T & T AT\&T AT&T实验室启动的开源工具包,用于绘制 D O T DOT DOT语言脚本描述的图形。 实现可视化效果(官网摘取)&#xf…

三维重建-使用开源库openMVG与openMVS

在前面我们已经介绍了编译openMVG与openMVS的方法,得到了openMVG与openMVS的x64位的Debug版本和Release版本 vcpkg问题-环境配置 关于使用vcpkg的一些技巧补充 openMVG编译 openMVS编译 参考博客: https://blog.csdn.net/qq_39615622/article/detai…

在Graphviz中画出好看的二叉树、B树、如何使用pos变量

一、二叉树 (一) 前提 使用过Graphviz画二叉树的同学都会发现,画出来的东西没有像教材那样规规矩矩,对于有强迫症的同学来说,可以采用以下思路进行完善 (二) IDEA Dot startuml digraph btree {graph [nodesep0.1, pad0.02, ranksep0.5]…

pygraphviz 学习笔记

pygraphviz 学习笔记 个人认为python第三方库中 graphviz比 pygraphviz好,以下是之前学习pygraphviz的笔记: G.add_path(nlist) 按nlist增加路径 G.clear() Remove all nodes, edges, and attributes from the graph. G.degree(nbunchNone, with_labelsF…

ROS中使用激光雷达HLS-LFCD LDS(Neato XV-11)

本例激光雷达: HLS-LFCD2 参考资料: https://blog.csdn.net/jacka654321/article/details/82916688 接线 新款 CP2102模块 USB to TTL USB转串口模块UART 按照激光雷达pin脚描述图;从1-6把把6pin接头的线顺序接到并排杜邦线上, 6pin …

neato xv21 ros下使用

修改neato_node 下neato.py文件如下: #!/usr/bin/env python # ROS node for the Neato Robot Vacuum # Copyright (c) 2010 University at Albany. All right reserved. # # Redistribution and use in source and binary forms, with or without # modification…

激光雷达neato_laser与电脑连接记录

激光雷达neato_laser与电脑连接记录 第一步,建立工作空间 在虚拟机打开一个新的终端 mkdir -p ~/shizhan01_ws/src (shizhan01_ws是工作空间名字,这个名字不建议取catkin_ws,因为网上很多例程都是用这个名字作为命名空间&#…