cs50 / style50

https://cs50.readthedocs.io/style50/
GNU General Public License v3.0
61 stars 31 forks source link

i tried style50 on my mac. I've done all the setting up, but this happen. How do i fix this? #103

Closed alexander-code-bit closed 2 years ago

alexander-code-bit commented 2 years ago

$ style50 hello.c Traceback (most recent call last): File "/usr/local/bin/style50", line 5, in from style50.main import main File "/usr/local/lib/python3.10/site-packages/style50/init.py", line 20, in from ._api import Style50, StyleCheck, Error File "/usr/local/lib/python3.10/site-packages/style50/_api.py", line 21, in from . import version, renderer File "/usr/local/lib/python3.10/site-packages/style50/renderer/init.py", line 1, in from ._renderers import to_ansi, to_html, to_json, to_ansi_score File "/usr/local/lib/python3.10/site-packages/style50/renderer/_renderers.py", line 4, in import jinja2 File "/usr/local/lib/python3.10/site-packages/jinja2/init.py", line 12, in from .environment import Environment File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 25, in from .defaults import BLOCK_END_STRING File "/usr/local/lib/python3.10/site-packages/jinja2/defaults.py", line 3, in from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 File "/usr/local/lib/python3.10/site-packages/jinja2/filters.py", line 13, in from markupsafe import soft_unicode ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.10/site-packages/markupsafe/init.py)

rongxin-liu commented 2 years ago

Try running this command and see if it fixes the issue:

pip3 install style50 --upgrade

Alternatively, please install markupsafe==2.0.1 by running:

pip3 install markupsafe==2.0.1