ModuleNotFoundError:AWS 构建中没有命名的模块

发布于 2025-01-12 01:23:49 字数 2845 浏览 0 评论 0原文

我可以在本地 MAC 上运行该项目,但是当我使用管道来构建它时。我收到这个错误: 命令“python setup.py Egg_info”失败,错误代码为 1 in /tmp/pip-build-axjgd0da/MarkupSafe/

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

以下是构建日志:

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

I can run the project on my local MAC, but when I use the pipeline to build it. I got this error:
Command "python setup.py 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))



  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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘味果▽酱 2025-01-19 01:23:49

是版本问题。

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文