datapane / datapane

Build and share data reports in 100% Python

Home Page:https://datapane.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when importing datapane in datapane\client\api\report\core.py

erez-b opened this issue · comments

System Information

  • OS: Windows 10
  • Python version: 3.10.4
  • Python environment: pip
  • Using jupyter: false
  • Datapane version: 0.15.1

Bug / Issue

When running "import datapane" I get the following error:

File "C:\Program Files\Python310\lib\site-packages\datapane\client\api\report\core.py", line 17, in
from jinja2 import Environment, FileSystemLoader, Template, contextfunction
ImportError: cannot import name 'contextfunction' from 'jinja2' (C:\Users\uname\Documents\python310\lib\site-packages\jinja2_init_.py)

After short research I found out that "contextfunction" was replaced by "pass_context" starting jinja2 version 3.0

I've never used jinja2, so I have no idea what other changes they made, so I'm not sure if my basic solution would work (import pass_context as contextfunction". It does solve the import at least.

Thanks for raising - we're actually working on support for the latest Jinja right now so should have a fix out within the next few days!

Fixed in b9eab94 - release due next week

Hey @erez-b - this should have been fixed in the recent release! Thank you for raising this - please let us know if anything else comes up!