By using AWS re:Post, you agree to the Terms of Use

Error: ModuleNotFoundError: No module named in AWS Build


I can run the project on my local MAC, but when I use the pipeline to build it. I got this error: Command "python egg_info" failed with error code 1 in /tmp/pip-build-axjgd0da/MarkupSafe/

This project is working well, and I did not update any new lib in it. Even I redeployed to the old branch, it has the same error.

Here are the build logs: `Collecting MarkupSafe==2.1.0 (from -r /usr/src/app/requirements.txt (line 1))


Complete output from command python egg_info:

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip-build-axjgd0da/MarkupSafe/", line 65, in <module>


  File "/tmp/pip-build-axjgd0da/MarkupSafe/", line 44, in run_setup

    ext_modules=ext_modules if with_binary else [],

  File "/usr/lib/python3.7/site-packages/setuptools/", line 129, in setup

    return distutils.core.setup(**attrs)

  File "/usr/lib64/python3.7/distutils/", line 121, in setup


  File "/usr/lib/python3.7/site-packages/setuptools/", line 442, in parse_config_files


  File "/usr/lib/python3.7/site-packages/setuptools/", line 106, in parse_configuration


  File "/usr/lib/python3.7/site-packages/setuptools/", line 382, in parse


  File "/usr/lib/python3.7/site-packages/setuptools/", line 355, in parse_section

    self[name] = value

  File "/usr/lib/python3.7/site-packages/setuptools/", line 173, in __setitem__

    value = parser(value)

  File "/usr/lib/python3.7/site-packages/setuptools/", line 430, in _parse_version

    version = self._parse_attr(value)

  File "/usr/lib/python3.7/site-packages/setuptools/", line 305, in _parse_attr

    module = import_module(module_name)

  File "/usr/lib64/python3.7/importlib/", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load

  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'markupsafe'


Command "python egg_info" failed with error code 1 in /tmp/pip-build-axjgd0da/MarkupSafe/

The command '/bin/sh -c pip3 install -r $DOCKER_APP_HOME/requirements.txt' returned a non-zero code: 1

make: *** [docker-build] Error 1`

1 Answer

It is a version problem.

The current version is 2.1.0, which I downgraded to Markupsafe==2.0.1. I added the "Markupsafe==2.0.1" in the requirements.txt, then I don't have the problem anymore.

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions