cog
cog copied to clipboard
render() throws error
Environment: Python 3.8.9 (default, Apr 21 2021, 23:14:29) [GCC 10.2.0] on cygwin cogdb==2.0.5 xxhash==2.0.0
Issue: When running your introductory example from the main page of https://cogdb.io/ (in a jupyter notebook), the following error was thrown:
OSError Traceback (most recent call last)
/usr/local/lib/python3.8/site-packages/cog/torque.py in render(self) 324 iframe_html = r""" """.format(self.html) 325 from IPython.core.display import display, HTML --> 326 display(HTML(iframe_html)) 327 328 def persist(self):
/usr/lib/python3.8/site-packages/IPython/core/display.py in init(self, data, url, filename, metadata) 716 if warn(): 717 warnings.warn("Consider using IPython.display.IFrame instead") --> 718 super(HTML, self).init(data=data, url=url, filename=filename, metadata=metadata) 719 720 def repr_html(self):
/usr/lib/python3.8/site-packages/IPython/core/display.py in init(self, data, url, filename, metadata) 628 self.metadata = {} 629 --> 630 self.reload() 631 self._check_data() 632
/usr/lib/python3.8/site-packages/IPython/core/display.py in reload(self) 653 """Reload the raw data from file or URL.""" 654 if self.filename is not None: --> 655 with open(self.filename, self._read_flags) as f: 656 self.data = f.read() 657 elif self.url is not None:
OSError: [Errno 91] File name too long: ' <iframe srcdoc='\n\n\n
\nThanks
@mgierdal what OS are you running your Jupyter notebook on? As a side note, currently ‘view()’ is fully supported only Linux and OSX. If you could try using another environment, I suggest Google Colab notebooks (https://colab.research.google.com/).
@mgierdal You could also try just returning the result of the graph traversal : g.v().tag("from").out("follows").tag("to").all()
and then visualize it on cogdb.io > visualization tab.
@mgierdal what OS are you running your Jupyter notebook on? As a side note, currently only Linux and OSX is supported. If you could try using another environment, I suggest Google Colab notebooks (https://colab.research.google.com/).
It's running on cygwin, which enables Unix-like environment on Windows. It's really very rare to encounter incompatibilities. Effectively cog is NOT running on Windows.
Using Colab notebooks or visualization tab is out of question, unfortunately. While I wasn't to "shoot tanks" with cogdb, I intended to put it to small scale, but serious use.
Out of curiosity, what are the main issues preventing from using it under actual Windows?
Using Colab notebooks or visualization tab is out of question, unfortunately. While I wasn't to "shoot tanks" with cogdb, I intended to put it to small scale, but serious use.
It looks like the error occurs when using 'render()' which depends on IPython's display module - perhaps there is some incompatibly. You could still see the visualization without using render. You can get the location of the html view file using this: g.v().tag("from").out("follows").tag("to").view("follows").url
And view the html file containing the graph visualization using a web browser.
Out of curiosity, what are the main issues preventing from using it under actual Windows?
@mgierdal There is nothing preventing it from running on Windows but currently there is no testing done in Windows environment. In theory everything should work just fine on Windows in standard Python. The only exception to that is the 'render' function which is meant to display graph visualizations directly in an IPython notebook.