olofk / edalize

An abstraction library for interfacing EDA tools
BSD 2-Clause "Simplified" License
606 stars 184 forks source link

Jinja2 issue witth edarool loader #419

Open CCCDDDEEEFFF opened 3 months ago

CCCDDDEEEFFF commented 3 months ago

There seems to be an issue with the loaders in edatools.py that has been driving me crazy for days.

I've tried multiple versions of edalize, fusesoc, and jinja but nothing seems to work.

File "/usr/local/bin/fusesoc", line 11, in load_entry_point('fusesoc==0.5', 'console_scripts', 'fusesoc')() File "/usr/local/lib/python3.6/dist-packages/fusesoc/main.py", line 775, in main fusesoc(args) File "/usr/local/lib/python3.6/dist-packages/fusesoc/main.py", line 765, in fusesoc args.func(cm, args) File "/usr/local/lib/python3.6/dist-packages/fusesoc/main.py", line 336, in run args.verbose, File "/usr/local/lib/python3.6/dist-packages/fusesoc/main.py", line 435, in run_backend backend = backend_class(edam=edam, work_root=work_root, verbose=verbose) File "/usr/local/lib/python3.6/dist-packages/edalize/edatool.py", line 183, in init loader=PackageLoader(package, "templates"), File "/usr/local/lib/python3.6/dist-packages/jinja2/loaders.py", line 291, in init assert loader is not None, "A loader was not found for the package." AssertionError: A loader was not found for the package.

olofk commented 3 months ago

I have seen this problem popping up a couple of times in other places, and I have absolutely zero idea of what is going on and I'm not able to reporoduce it here. I would very much like to find a solution to this but don't know where to start.

olofk commented 3 months ago

Maybe you could try to just change __package__ to Edalize on line 183 in edatool and see if that helps?

DVCoder commented 3 months ago

I'm also running into a similar issue. Please let me know if anyone has a fix/workaround.

DVCoder commented 3 months ago

Found a fix that worked for me. I was also using Python 3.6 and I upgraded to Python 3.9 and that fixed it for me.