Python程序无法导入点解析器

海德

我试图从命令行运行一个巨大的模拟python软件的进化。该软件取决于以下python软件包:

1个网络X

2解析

3个

4点

5-matplotlib

6图

我得到的错误是这样的:

Couldn't import dot_parser, loading of dot files will not be possible.
initializing with file= initAdapt.py in model dir= ./Test_adaptation//
Traceback (most recent call last):
  File "run_evolution.py", line 230, in <module>
    gr.write_dot( os.path.join(test_output_dir, 'test_net.dot') )
  File "/Library/Python/2.7/site-packages/pydot.py", line 1602, in <lambda>
    lambda path, f=frmt, prog=self.prog : self.write(path, format=f,          prog=prog))
  File "/Library/Python/2.7/site-packages/pydot.py", line 1696, in write
    dot_fd.write(self.create(prog, format))
  File "/Library/Python/2.7/site-packages/pydot.py", line 1740, in create
    self.write(tmp_name)
  File "/Library/Python/2.7/site-packages/pydot.py", line 1694, in write
    dot_fd.write(self.to_string())
  File "/Library/Python/2.7/site-packages/pydot.py", line 1452, in to_string
    graph.append( node.to_string()+'\n' )
  File "/Library/Python/2.7/site-packages/pydot.py", line 722, in to_string
    node_attr.append( attr + '=' + quote_if_necessary(value) )
TypeError: cannot concatenate 'str' and 'int' objects

我已经尝试过针对堆栈溢出的类似问题建议的解决方案我仍然收到相同的错误。这是我正在使用的软件包版本以及我的python版本。

  • 我正在使用python 2.7.6
  • 输入命令将which -a python产生结果:“ / usr / bin / python”。

1-解析(1.5.7)

2点(1.0.2)

3-matplotlib(1.3.1)

4-graphviz(0.4.2)

5网络x(0.37)

6 numpy(1.8.0rc1)

有任何想法吗?鉴于解决类似问题的方法对我不起作用,因此我认为该问题可能对我而言更为根本。我安装python的方式可能出了问题。

robert_x44

您没有使用最新版本的pydot的任何特殊原因?

1.0.2的此修订版似乎完全解决了该问题:

https://code.google.com/p/pydot/source/diff?spec=svn10&r=10&format=side&path=/trunk/pydot.py

参见第722行。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章