Skip to content

Got dependency issue with spacy and markupsafe #1269

Closed
@xwang233

Description

@xwang233

After this PR #1261 change 94078d9#diff-fcf1c48cd82709b9bd6dc7881e2a425d15502a75925097be18583a7c6a0ffdafR5, while doing python install.py, I got

root@f3b64780b5e8:/workspace/torch-benchmark/benchmark# python install.py
checking packages torch, torchvision, torchtext, torchaudio are installed...OK
checking out Git LFS files...OK
decompressing input tarball: tacotron2-minimal.tar.gz...OK
decompressing input tarball: LearningToPaint_inputs.tar.gz...OK
decompressing input tarball: Background_Matting_inputs.tar.gz...OK
decompressing input tarball: Super_SloMo_inputs.tar.gz...OK
decompressing input tarball: pytorch_stargan_inputs.tar.gz...OK
decompressing input tarball: coco2017-minimal.tar.gz...OK
decompressing input tarball: pytorch_CycleGAN_and_pix2pix_inputs.tar.gz...OK
decompressing input tarball: coco128.tar.gz...OK
decompressing input tarball: multi30k.tar.gz...OK
decompressing input tarball: speech_transformer_inputs.tar.gz...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/BERT_pytorch...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/Background_Matting...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/DALLE2_pytorch...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/LearningToPaint...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/Super_SloMo...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/alexnet...OK
running setup for /opt/pytorch/benchmark/torchbenchmark/models/attention_is_all_you_need_pytorch...FAIL
Error for /opt/pytorch/benchmark/torchbenchmark/models/attention_is_all_you_need_pytorch:
---------------------------------------------------------------------------
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/runpy.py", line 185, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/conda/lib/python3.8/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/conda/lib/python3.8/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/opt/conda/lib/python3.8/site-packages/spacy/__init__.py", line 15, in <module>
    from .cli.info import info  # noqa: F401
  File "/opt/conda/lib/python3.8/site-packages/spacy/cli/__init__.py", line 17, in <module>
    from .debug_diff import debug_diff  # noqa: F401
  File "/opt/conda/lib/python3.8/site-packages/spacy/cli/debug_diff.py", line 10, in <module>
    from .init_config import init_config, Optimizations
  File "/opt/conda/lib/python3.8/site-packages/spacy/cli/init_config.py", line 8, in <module>
    from jinja2 import Template
  File "/opt/conda/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/opt/conda/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/opt/conda/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/opt/conda/lib/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/conda/lib/python3.8/site-packages/markupsafe/__init__.py)
Traceback (most recent call last):
  File "install.py", line 22, in <module>
    spacy_download('en_core_web_sm')
  File "install.py", line 10, in spacy_download
    subprocess.check_call([sys.executable, '-m', 'spacy', 'download', language])
  File "/opt/conda/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/opt/conda/bin/python', '-m', 'spacy', 'download', 'en_core_web_sm']' returned non-zero exit status 1.



---------------------------------------------------------------------------

Traceback (most recent call last):
  File "install.py", line 134, in <module>
    raise RuntimeError("Failed to complete setup")
RuntimeError: Failed to complete setup

There is a similar issue aws/aws-sam-cli#3661 (comment).

My temporary workaround is to pin the package version markupsafe==2.0.1 like this
xwang233@3dcf675

cc @xuzhao9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions