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

Python markupsafe dependency error in 03-training-formalization.ipynb #24

Open
hilliao opened this issue Jun 23, 2022 · 0 comments
Open

Comments

@hilliao
Copy link

hilliao commented Jun 23, 2022

The latest Python 3 package markupsafe is not compatible with from tfx.orchestration.experimental.interactive.interactive_context import InteractiveContext:

import ml_metadata as mlmd
from ml_metadata.proto import metadata_store_pb2
from tfx.orchestration.experimental.interactive.interactive_context import InteractiveContext

Error:

ImportError Traceback (most recent call last)
/tmp/ipykernel_1/3645963042.py in
1 import ml_metadata as mlmd
2 from ml_metadata.proto import metadata_store_pb2
----> 3 from tfx.orchestration.experimental.interactive.interactive_context import InteractiveContext
4
5 connection_config = metadata_store_pb2.ConnectionConfig()

~/.local/lib/python3.7/site-packages/tfx/orchestration/experimental/interactive/interactive_context.py in
35
36 import absl
---> 37 import jinja2
38 import nbformat
39 from tfx import types

~/.local/lib/python3.7/site-packages/jinja2/init.py in
10 from .bccache import FileSystemBytecodeCache
11 from .bccache import MemcachedBytecodeCache
---> 12 from .environment import Environment
13 from .environment import Template
14 from .exceptions import TemplateAssertionError

~/.local/lib/python3.7/site-packages/jinja2/environment.py in
23 from .compiler import CodeGenerator
24 from .compiler import generate
---> 25 from .defaults import BLOCK_END_STRING
26 from .defaults import BLOCK_START_STRING
27 from .defaults import COMMENT_END_STRING

~/.local/lib/python3.7/site-packages/jinja2/defaults.py in
1 # -- coding: utf-8 --
2 from ._compat import range_type
----> 3 from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
4 from .tests import TESTS as DEFAULT_TESTS # noqa: F401
5 from .utils import Cycler

~/.local/lib/python3.7/site-packages/jinja2/filters.py in
11 from markupsafe import escape
12 from markupsafe import Markup
---> 13 from markupsafe import soft_unicode
14
15 from ._compat import abc

ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/jupyter/.local/lib/python3.7/site-packages/markupsafe/init.py)

The workaround is to install an older version by pip install markupsafe==2.0.1 and restart kernel

@hilliao hilliao changed the title Python markupsafe dependency error Python markupsafe dependency error in 03-training-formalization.ipynb Jun 23, 2022
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

1 participant