ModuleNotFoundError:AWS 构建中没有命名的模块
我可以在本地 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是版本问题。
当前版本是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.