ModuleNotFoundError: No module named in AWS Build

ModuleNotFoundError: No module named in AWS Build

我可以 运行 我本地 MAC 上的项目,但是当我使用管道构建它时。我收到此错误: 命令“python setup.py egg_info”在 /tmp/pip-build-axjgd0da/MarkupSafe/

中失败,错误代码为 1

这个项目运行良好,我没有更新其中的任何新库。即使我重新部署到旧分支,它也有同样的错误。

以下是构建日志:

Collecting MarkupSafe==2.1.0 (from -r /usr/src/app/requirements.txt (line 1))



  Downloading https://files.pythonhosted.org/packages/62/0f/52c009332fdadd484e898dc8f2acca0663c1031b3517070fd34ad9c1b64e/MarkupSafe-2.1.0.tar.gz



    Complete output from command python setup.py egg_info:



    Traceback (most recent call last):



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



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



        run_setup(True)



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



        ext_modules=ext_modules if with_binary else [],



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



        return distutils.core.setup(**attrs)



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



        dist.parse_config_files()



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



        ignore_option_errors=ignore_option_errors)



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



        meta.parse()



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



        section_parser_method(section_options)



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



        self[name] = value



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



        value = parser(value)



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



        version = self._parse_attr(value)



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



        module = import_module(module_name)



      File "/usr/lib64/python3.7/importlib/__init__.py", 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 setup.py 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

版本问题

当前版本是2.1.0,我降级到Markupsafe==2.0.1。我在 requirements.txt 中添加了“Markupsafe==2.0.1”,然后我就没有问题了。