name 'Image' is not defined
Opened this issue · 1 comments
Bug description
Error occurring in celery worker while exporting dashboard as PDF using chrome driver
`The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\venv\Lib\site-packages\superset\tasks\scheduler.py", line 95, in execute
).run()
^^^^^
File "C:\venv\Lib\site-packages\superset\utils\decorators.py", line 266, in wrapped
return on_error(ex)
^^^^^^^^^^^^
File "C:\venv\Lib\site-packages\superset\utils\decorators.py", line 236, in on_error
raise ex
File "C:\venv\Lib\site-packages\superset\utils\decorators.py", line 259, in wrapped
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\venv\Lib\site-packages\superset\commands\report\execute.py", line 803, in run
raise ReportScheduleUnexpectedError(str(ex)) from ex
superset.commands.report.exceptions.ReportScheduleUnexpectedError: name 'Image' is not defined`
Screenshots/recordings
No response
Superset version
4.1.0
Python version
3.11
Node version
18 or greater
Browser
Chrome
Additional context
No response
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
To resolve the "name 'Image' is not defined" error in the Celery worker while exporting a dashboard as PDF using the Chrome driver in Superset version 4.1.0 with Python 3.11, you need to ensure that the Python Imaging Library (PIL) is installed. This error occurs because the Image
module from PIL is not found. You can fix this by installing the Pillow
package, which is the modern version of PIL. Run the following command to install it:
pip install Pillow
This will make the Image
module available, resolving the error [1].