prakhar1989/docker-curriculum

[BUG] ModuleNotFoundError: No module named 'markupsafe' when building foodtrucks-web

stevebd22 opened this issue · 2 comments

Hello Dockerfans,
I am not able to build the foodtrucks image, can anyone give his/her advice?
Command executed: docker build -t stevebd/foodtrucks-web .

#13 2.142 Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
#13 2.162 Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.23.0->-r requirements.txt (line 3))
#13 2.166 Collecting MarkupSafe>=2.0 (from Jinja2>=3.0->Flask==2.0.2->-r requirements.txt (line 2))
#13 2.285 Downloading https://files.pythonhosted.org/packages/bf/10/ff66fea6d1788c458663a84d88787bae15d45daa16f6b3ef33322a51fc7e/MarkupSafe-2.0.1.tar.gz
#13 2.424 Complete output from command python setup.py egg_info:
#13 2.424 Traceback (most recent call last):
#13 2.424 File "", line 1, in
#13 2.424 File "/tmp/pip-build-ccabr2it/MarkupSafe/setup.py", line 61, in
#13 2.424 run_setup(True)
#13 2.424 File "/tmp/pip-build-ccabr2it/MarkupSafe/setup.py", line 44, in run_setup
#13 2.424 ext_modules=ext_modules if with_binary else [],
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/init.py", line 129, in setup
#13 2.424 return distutils.core.setup(**attrs)
#13 2.424 File "/usr/lib/python3.6/distutils/core.py", line 121, in setup
#13 2.424 dist.parse_config_files()
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 494, in parse_config_files
#13 2.424 ignore_option_errors=ignore_option_errors)
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/config.py", line 106, in parse_configuration
#13 2.424 meta.parse()
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/config.py", line 382, in parse
#13 2.424 section_parser_method(section_options)
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/config.py", line 355, in parse_section
#13 2.424 self[name] = value
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/config.py", line 173, in setitem
#13 2.424 value = parser(value)
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/config.py", line 430, in _parse_version
#13 2.424 version = self._parse_attr(value)
#13 2.424 File "/usr/lib/python3/dist-packages/setuptools/config.py", line 305, in _parse_attr
#13 2.424 module = import_module(module_name)
#13 2.424 File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
#13 2.424 return _bootstrap._gcd_import(name[level:], package, level)
#13 2.424 File "", line 994, in _gcd_import
#13 2.424 File "", line 971, in _find_and_load
#13 2.424 File "", line 953, in _find_and_load_unlocked
#13 2.424 ModuleNotFoundError: No module named 'markupsafe'
#13 2.424
#13 2.424 ----------------------------------------
#13 2.436 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ccabr2it/MarkupSafe/

executor failed running [/bin/sh -c pip3 install -r requirements.txt]: exit code: 1

Solved:
open FoodTrucks/Dockerfile insert RUN apt-get install -y python3-markupsafe before RUN npm install
It was posted previously by Halpert3. thx.

thank you!