Python 运行时错误:无法导入 pydot [英] Python RuntimeError: Failed to import pydot

查看:43
本文介绍了Python 运行时错误:无法导入 pydot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习逻辑回归概念的概念.当我在 python 中实现它时,它显示了下面提到的一些错误.我是python的初学者.有人可以帮忙纠正这个错误吗?

I am learning concepts of logistic regression concepts. When i implement it in python, it shows me some error mentioned below. I am beginner in python. Could anybody help to rectify this error?

RuntimeError Traceback(最近一次调用最后一次)在 ()

RuntimeError Traceback (most recent call last) in ()

64 theano.printing.pydotprint(predict,
65                            outfile="pics/logreg_pydotprint_predic.png",
66                            var_with_name_simple=True)
67 # before compilation
68 theano.printing.pydotprint_variables(prediction,

C:\Anaconda\lib\site-packages\theano\printing.pyc in pydotprint(fct, outfile, compact, format, with_ids, high_contrast, cond_highlight, colorCodes, max_label_size, scan_graphs, var_with_name_simple, print_output_file, assert_nb_all_strings)>

C:\Anaconda\lib\site-packages\theano\printing.pyc in pydotprint(fct, outfile, compact, format, with_ids, high_contrast, cond_highlight, colorCodes, max_label_size, scan_graphs, var_with_name_simple, print_output_file, assert_nb_all_strings)

565 
566     if not pydot_imported:
567         raise RuntimeError("Failed to import pydot. You must install pydot"
568                             " for `pydotprint` to work.")
569         return

运行时错误:无法导入 pydot.您必须安装 pydot 才能pydotprint 工作.

RuntimeError: Failed to import pydot. You must install pydot for pydotprint to work.

推荐答案

这主要取决于你把 pydot 文件放在哪里.如果您直接从 Python Shell 运行它,那么您应该将它们安装在模块文件夹中,该文件夹通常是主 python 文件夹中的Lib"文件夹.

It mainly depends on where you put the pydot files. If you are running it straight from the Python Shell then you should have them installed in the modules folder which is most commonly the "Lib" folder inside the main python folder.

这篇关于Python 运行时错误:无法导入 pydot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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