Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work, ImportError: cannot import name 'soft_unicode' from 'markupsafe' #20

Open
sshbio opened this issue Aug 1, 2022 · 3 comments

Comments

@sshbio
Copy link

sshbio commented Aug 1, 2022

The package return error ImportError: cannot import name 'soft_unicode' from 'markupsafe' using CLI, version 0.3.3 related to dependency jinja2/utils.py

@sshbio
Copy link
Author

sshbio commented Aug 2, 2022

$avro-to-python --help
Traceback (most recent call last):
  File "/usr/local/bin/avro-to-python", line 5, in <module>
    from avro_to_python.cli import main
  File "/usr/local/lib/python3.10/site-packages/avro_to_python/cli.py", line 11, in <module>
    from avro_to_python.writer.writer import AvroWriter
  File "/usr/local/lib/python3.10/site-packages/avro_to_python/writer/__init__.py", line 1, in <module>
    from avro_to_python.writer.writer import AvroWriter
  File "/usr/local/lib/python3.10/site-packages/avro_to_python/writer/writer.py", line 5, in <module>
    from jinja2 import Environment, FileSystemLoader
  File "/usr/local/lib/python3.10/site-packages/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 15, in <module>
    from jinja2 import nodes
  File "/usr/local/lib/python3.10/site-packages/jinja2/nodes.py", line 19, in <module>
    from jinja2.utils import Markup
  File "/usr/local/lib/python3.10/site-packages/jinja2/utils.py", line 642, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.10/site-packages/markupsafe/__init__.py)

@SRserves85
Copy link
Owner

Newer versions of Jinja have changed the dependencies for markupsafe I believe

@nicanor-romero
Copy link

Temporal fix that worked for me

pip3 install markupsafe==2.0.1

dixler pushed a commit to pulumi/docs that referenced this issue Mar 6, 2023
Pinned m2r < 2.0.0 according to suggestion in Azure/azure-sdk-for-python#22019 (comment)
Bumped Jinja2 to 3.1.2 in Pipenv according to discussion in SRserves85/avro-to-python#20
dixler pushed a commit to pulumi/docs that referenced this issue Mar 6, 2023
Pinned m2r < 2.0.0 according to suggestion in Azure/azure-sdk-for-python#22019 (comment)
Bumped Jinja2 to 3.1.2 in Pipenv according to discussion in SRserves85/avro-to-python#20
dixler pushed a commit to pulumi/docs that referenced this issue Mar 6, 2023
Pinned m2r < 2.0.0 according to suggestion in Azure/azure-sdk-for-python#22019 (comment)
Bumped Jinja2 to 3.1.2 in Pipenv according to discussion in SRserves85/avro-to-python#20
dixler pushed a commit to pulumi/docs that referenced this issue Mar 6, 2023
Pinned `m2r<2.0.0` according to suggestion in Azure/azure-sdk-for-python#22019 (comment)
Pinned `markupsafe==2.0.1` according to discussion in SRserves85/avro-to-python#20
justinvp pushed a commit to pulumi/docs that referenced this issue Mar 7, 2023
Pinned `m2r<2.0.0` according to suggestion in Azure/azure-sdk-for-python#22019 (comment)
Pinned `markupsafe==2.0.1` according to discussion in SRserves85/avro-to-python#20
dixler pushed a commit to pulumi/docs that referenced this issue Mar 7, 2023
Pinned `m2r<2.0.0` according to suggestion in Azure/azure-sdk-for-python#22019 (comment)
Pinned `markupsafe==2.0.1` according to discussion in SRserves85/avro-to-python#20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants