python pydot安装

本文详细介绍了使用pip安装pydot时遇到的导入问题,并提供了解决方法和安装步骤。通过修改代码和使用旧版pyparsing,最终成功解决了pydot_parser无法识别的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

大概参照 http://www.th7.cn/Program/Python/201410/304267.shtml

的教程安装的。即


关于这一点,pydot的readme也有说明。

pydot用的是1.0.25,其中提示有问题,改了一小点代码。

然后上图test中的例子过了,可是在实际用的时候pydot_parser提示无法识别。

最后参考: http://stackoverflow.com/questions/15951748/pydot-and-graphviz-error-couldnt-import-dot-parser-loading-of-dot-files-will/17902926#17902926

For anyone else who comes across this, it is due to the changes in pyparsing from 1.x to the 2.x release. To install pydot using pip, first install the older version of pyparsing:

pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709
pip install pydot
安装、运行成功。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值