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

Can't run d3py_graph.py example: 'NetworkXFigure' object has no attribute 'httpd' #61

Closed
ceball opened this issue Mar 21, 2013 · 3 comments

Comments

@ceball
Copy link

ceball commented Mar 21, 2013

I cloned d3py and tried to run the d3py_graph.py example, but ran into a problem.

$ git clone git://github.com/mikedewar/d3py.git
[...]
$ cd d3py/
$ python setup.py install
[...]
$ cd examples/
$ python d3py_graph.py 
Traceback (most recent call last):
  File "d3py_graph.py", line 15, in <module>
    with d3py.NetworkXFigure(G, width=500, height=500) as p:
  File "[...]/local/lib/python2.7/site-packages/d3py/networkx_figure.py", line 39, in __init__
    port=port, **kwargs
TypeError: __init__() takes exactly 10 arguments (9 given)
Error in clean-up: 'NetworkXFigure' object has no attribute 'httpd'

I just discovered d3py a few minutes ago, so forgive me if I've missed something. I got the demo to run like this:

$ git diff
diff --git a/examples/d3py_graph.py b/examples/d3py_graph.py
index 99c73ba..b1d9e6a 100644
--- a/examples/d3py_graph.py
+++ b/examples/d3py_graph.py
@@ -12,6 +12,6 @@ G.add_edge(3,4)
 G.add_edge(4,2)

 # use 'with' if you are writing a script and want to serve this up forever
-with d3py.NetworkXFigure(G, width=500, height=500) as p:
+with d3py.NetworkXFigure(G, width=500, height=500, host='localhost') as p:
     p += d3py.ForceLayout()
     p.show()

Unlike PandasFigure(Figure), NetworkXFigure(Figure) does not have a default host argument.

@kern3020
Copy link

Hello,

@mikedewar I'll need to update and run these example to test my re-factoring for #57. If you want to assign this one to me, I can ensure it works with my pull request.

-jk

@kern3020
Copy link

@ceball Just submitted a pull request which cleans this up.

@happyhuman
Copy link

Hi
I had the same exact issue running d3py_graph.py on a Mac. I was wondering if this issue has been resolved.

@ceball ceball closed this as completed Nov 28, 2019
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

3 participants