earthobservations / luftdatenpumpe

Acquire and process live and historical air quality data without efforts. Filter by station-id, sensor-id and sensor-type, apply reverse geocoding, store into time-series and RDBMS databases, publish to MQTT, output as JSON, or visualize in Grafana. Data sources: Sensor.Community (luftdaten.info), IRCELINE, and OpenAQ.
https://luftdatenpumpe.readthedocs.io/
GNU Affero General Public License v3.0
34 stars 3 forks source link

ImportError: cannot import name 'soft_unicode' from 'markupsafe' #33

Closed MauritsDescamps closed 2 years ago

MauritsDescamps commented 2 years ago

Running any luftdatenpumpe command reults in the following Import Error. ImportError: cannot import name 'soft_unicode' from 'markupsafe'

Command: luftdatenpumpe --help Trace:

Traceback (most recent call last):
  File "/usr/local/Caskroom/miniconda/base/envs/PM/bin/luftdatenpumpe", line 5, in <module>
    from luftdatenpumpe.commands import run
  File "/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/luftdatenpumpe/commands.py", line 10, in <module>
    from luftdatenpumpe.grafana import get_artefact
  File "/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/luftdatenpumpe/grafana/__init__.py", line 6, in <module>
    from jinja2 import Template
  File "/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/jinja2/environment.py", line 15, in <module>
    from jinja2 import nodes
  File "/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/jinja2/utils.py", line 647, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/Caskroom/miniconda/base/envs/PM/lib/python3.8/site-packages/markupsafe/__init__.py)

Python version: 3.8.13 Pip version: 21.2.4 luftdatenpumpe version: 0.20.2

The problem seems to be similar to the one incountered here: https://github.com/aws/aws-sam-cli/issues/3661#issue-1142404492

MauritsDescamps commented 2 years ago

I downgraded markupsafe as a temporary fix: pip install markupsafe==2.0.1

amotl commented 2 years ago

Dear @MauritsDescamps,

thank you very much for your report. It is sweet to hear back from other active users of Luftdatenpumpe. ce68c88a brings the dependencies up to speed and will hopefully mitigate the problems you have been observing on behalf of the next release.

With kind regards, Andreas.

amotl commented 2 years ago

Dear @MauritsDescamps,

luftdatenpumpe 0.21.0 has been released and the issue you reported should have been addressed. We would love to hear back from you if everything works now. Otherwise, please create another issue, or otherwise add your report to #39.

Thank you again and with kind regards, Andreas.