Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot concatenate 'str' and 'int' objects #2

Closed
zimage opened this issue Jul 7, 2015 · 8 comments
Closed

cannot concatenate 'str' and 'int' objects #2

zimage opened this issue Jul 7, 2015 · 8 comments

Comments

@zimage
Copy link

zimage commented Jul 7, 2015

$ ./mnet-graph.py -r x.x.x.x -d 20 -f foo.svg -t "Network Diagram" -c ./mnet.conf
Couldn't import dot_parser, loading of dot files will not be possible.
MNet-Graph v0.1
Written by Michael Laforest <mjlaforest@gmail.com>

    Config file: ./mnet.conf
      Root node: x.x.x.x
    Output file: foo.svg
    Crawl depth: 20
  Diagram title: Network Diagram



router-name (x.x.x.x)
-----
----- DEVICES
-----
      Name: router-name
        IP: x.x.x.x
  Platform: UNKNOWN
   Routing: yes
   OSPF ID: x.x.x.x
   BGP LAS: 65001
  HSRP Pri: None
  HSRP VIP: None
 Stack Cnt: 0
  VSS Mode: 0
VSS Domain: None

-----
----- LINKS
-----
-----
----- Summary
-----
Discovered devices: 1
Discovered links:   0
Traceback (most recent call last):
  File "./mnet-graph.py", line 666, in <module>
    main(sys.argv[1:])
  File "./mnet-graph.py", line 492, in main
    output_dot(opt_dot, opt_title)
  File "./mnet-graph.py", line 661, in output_dot
    output_func(dot_file)
  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
@liftedkilt
Copy link

Did you install pydot?

@zimage
Copy link
Author

zimage commented Jul 7, 2015

$ pip show pydot
---
Metadata-Version: 1.1
Name: pydot
Version: 1.0.2
Summary: Python interface to Graphviz's Dot
Home-page: http://code.google.com/p/pydot/
Author: Ero Carrera
Author-email: ero@dkbza.org
License: MIT
Location: /Library/Python/2.7/site-packages
Requires: pyparsing, setuptools

@liftedkilt
Copy link

What distro?

On Tue, Jul 7, 2015, 12:43 PM Tim Nowaczyk notifications@github.com wrote:

$ pip show pydot

Metadata-Version: 1.1
Name: pydot
Version: 1.0.2
Summary: Python interface to Graphviz's Dot
Home-page: http://code.google.com/p/pydot/
Author: Ero Carrera
Author-email: ero@dkbza.org
License: MIT
Location: /Library/Python/2.7/site-packages
Requires: pyparsing, setuptools


Reply to this email directly or view it on GitHub
#2 (comment).

@zimage
Copy link
Author

zimage commented Jul 7, 2015

MacOS Yosemite.

@kamakazikamikaze
Copy link

We're also experiencing this error on Ubuntu 14.10 (Server).

@blake
Copy link

blake commented Jul 9, 2015

You want pydot2.

pip install pydot2

@MJL85
Copy link
Owner

MJL85 commented Jul 16, 2015

I had this problem today testing on Windows. I noticed pip would only install pydot 1.0.2. You can force it to update to 1.0.28 with:
# pip install --allow-unverified pydot pydot==1.0.28

This resolved the issue for me. However I am looking at moving to either pydot2 as blake mentioned or something else as pydot appears to no longer be under development. Also I added mnet to pip so you can install from there now.

@kamakazikamikaze
Copy link

If you do transition to pydot2 be sure to reference this StackOverflow submission. It looks like some files are omitted when upgrading/installing pydot2 because it expects some source code in pydot1 to already exist. If you don't add this into the README then a lot of users will experience said issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants