Python(3.5 、3.6、 3.7、 3.8版本)安装pygraphviz包--软件安装成功笔记

  1. 安装pygraphviz前,需要先安装graphviz,官网下载graphviz-2.38.mis,运行安装完成后,把其中的bin文件路径加入环境变量path中

在这里插入图片描述
在这里插入图片描述

  1. pygraphviz包下载链接:GitHub不同版本需要下不同版本的pygraphviz,cp38表示3.8版本,电脑是64位就选win_amd64,32位就选win32。

在这里插入图片描述

  1. 把pygraphviz包复制到名为Scripts的文件夹中

  2. 在命令行中cd到Scripts文件,pip install pygraphviz-1.5-cp38-cp38-win_amd64.whl
    在这里插入图片描述

  3. 测试代码

import pygraphviz as pgv
G = pgv.AGraph(directed=True,rankdir="TB")#有向从上到下
#设置节点
root = "CEO"
positive_1="COO"
positive_2="CTO"
positive_3="CMO"
positive_4="CFO"
positive_5="CSO"
negative_6="客服售后vp"
negative_7="仓储vp"
negative_8="工程VP"
negative_9="前台VP"
negative_10="后台VP"
negative_11="架构VP"
negative_12="数据VP"
negative_13="云VP"
negative_14="产品VP"
negative_15="大客户总监"
negative_16="公关VP"
negative_17="市场SVP"
negative_18="POP VP"
negative_19="图书VP"
negative_20="家电VP"
negative_21="财务VP"
negative_22="法务VP"
negative_23="审计总监"
negative_24="战略总监"
negative_25="行政总监"
negative_26="人力VP"
#设置节点
G.add_node(root,style="filled",shape="box3d",color="#feb64d")
for positive in[eval(_) for _ in dir() if _.startswith("positive")]:
    G.add_node(positive,style="filled",shape="circle",color="#CFDBF6")
for negative in[eval(_) for _ in dir() if _.startswith("negative")]:
    G.add_node(negative, style="filled", shape="polygon", color="#B4E7B7")
#添加边
G.add_edges_from([[root,positive_1],[root,positive_2],[root,positive_3],[root,positive_4],[root,positive_5]],
                 color="#CFDBF6",style="dashed",penwidth=1.5)
G.add_edges_from([[positive_1,negative_6],[positive_1,negative_7],[positive_1,negative_8],
                  [positive_2,negative_9],[positive_2,negative_10],[positive_2,negative_11],[positive_2,negative_12],[positive_2,negative_13],[positive_2,negative_14],
                  [positive_3,negative_15],[positive_3,negative_16],[positive_3,negative_17],[positive_3,negative_18],[positive_3,negative_19],[positive_3,negative_20],
                  [positive_4,negative_21],[positive_5,negative_22],[positive_5,negative_23],[positive_5,negative_24],[positive_5,negative_25],[positive_5,negative_26]],
                 color="#B4E7B7", style="dashed", penwidth=1.5)
G.layout()
G.draw("京东组织架构.png",prog="dot")

结果:
在这里插入图片描述
注:3.8版本总压缩包 百度网盘链接https://pan.baidu.com/s/1SD7JZ6TgKbKZgYk4V_NjPw
提取码:3uze
函数的参数解析案例:https://zhuanlan.zhihu.com/p/104636240

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ERROR: Ignored the following versions that require a different python version: 1.10.10 Requires-Python >=3.6,<3.8; 1.10.11 Requires-Python >=3.6,<3.8; 1.10.12 Requires-Python >=3.6,<3.8; 1.10.13 Requires-Python >=3.6,<3.8; 1.10.14 Requires-Python >=3.6,<3.8; 1.10.15 Requires-Python >=3.6,<3.8; 1.10.16 Requires-Python >=3.6,<3.8; 1.10.17 Requires-Python >=3.6,<3.8; 1.10.18 Requires-Python >=3.6,<3.8; 1.10.19 Requires-Python >=3.6,<3.8; 1.10.20 Requires-Python >=3.6,<3.8; 1.10.21 Requires-Python >=3.6,<3.8; 1.10.22 Requires-Python >=3.6,<3.8; 1.10.23 Requires-Python >=3.6,<3.8; 1.10.24 Requires-Python >=3.6,<3.8; 1.10.25 Requires-Python >=3.6,<3.8; 1.10.26 Requires-Python >=3.6,<3.8; 1.10.3 Requires-Python >=3.6,<3.8; 1.10.4 Requires-Python >=3.6,<3.8; 1.10.5 Requires-Python >=3.6,<3.8; 1.10.6 Requires-Python >=3.6,<3.8; 1.10.7 Requires-Python >=3.6,<3.8; 1.10.8 Requires-Python >=3.6,<3.8; 1.10.9 Requires-Python >=3.6,<3.8 ERROR: Could not find a version that satisfies the requirement tensorflow~=1.14.0 (from rasa) (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0, 2.11.1, 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.13.0rc0, 2.13.0rc1) ERROR: No matching distribution found for tensorflow~=1.14.0
06-13

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值