Open eivnd opened 1 year ago
I'm seeing the same issue. When running the basic network demo in the README.md, I get the same error:
g = Network()
g.add_node(0)
g.add_node(1)
g.add_edge(0, 1)
g.show("basic.html")
yields:
basic.html
Traceback (most recent call last):
File "<pyshell#45>", line 1, in <module>
g.show("basic.html")
File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvis\network.py", line 546, in show
self.write_html(name, open_browser=False,notebook=True)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvis\network.py", line 515, in write_html
self.html = self.generate_html(notebook=notebook)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\site-packages\pyvis\network.py", line 479, in generate_html
self.html = template.render(height=height,
AttributeError: 'NoneType' object has no attribute 'render'
Confirmed, same here!
The issue is probably from this commit https://github.com/WestHealth/pyvis/commit/4c5af7adb840fb6f8b7296c74fab6ecfc7c34e1f#diff-405e696560a2f03a44724592eb5a5cc65a972a257e639619c0a8f88a0069c0b9R536 , where the notebook
kwarg was introduced and set to True
by default. Calling show
with notebook=False
fixes the issue indeed. To avoid breaking backwards compatibility, notebook
should be set to False
in the function definition. Note that inline docs have also been neglected in that commit, the new param is not in the docstring.
@BerserkerGaruk
Hello,
I'm running a simple python code for visualising a network. It works fine with pyvis_0.3.1, but with pyvis_0.3.2 I get the following error message when calling