d3graph icon indicating copy to clipboard operation
d3graph copied to clipboard

ValueError from Jinja PackageLoader

Open akimotode opened this issue 3 years ago • 2 comments

When installing d3graph from pip I got the following error when initializing like this d3 = d3graph.d3graph().

ValueError: The 'd3graph.d3graph' package was not installed in a way that PackageLoader understands.

Error seems to be in line 538 of d3graph.js. I switched that line to the following statement, which solved the problem for me...

jinja_env = Environment(loader=PackageLoader('d3graph', package_path='d3js'))

Not sure if that is just me, or a general issue

akimotode avatar Sep 02 '22 12:09 akimotode

Thanks for mentioning it! I have been playing around and in my case it remains working using both approaches. Are you maybe using a Jupyter notebook?

I now added this line because I am not sure what happens to others when I replace it with your line. Can you maybe check whether such a solution works for you?

        try:
            jinja_env = Environment(loader=PackageLoader(package_name=__name__, package_path='d3js'))
        except:
            jinja_env = Environment(loader=PackageLoader(package_name='d3graph', package_path='d3js'))

erdogant avatar Sep 30 '22 09:09 erdogant

I created a new update. Can you try whether this solves your issue?

pip install -U d3graph

erdogant avatar Sep 30 '22 11:09 erdogant

If you still experience issues, let me know and reopen this issue. For now, I assume it is fixed and I am closing this one.

erdogant avatar Dec 02 '22 15:12 erdogant