cabot
cabot copied to clipboard
Service 'beat' failed to build : The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
While installing via docker-compose Ubuntu 20.04
Having a similar issue building with docker
Step 10/16 : RUN pip install --no-cache-dir -r requirements.txt
---> Running in cb3bf9635c9b
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==21.0.1', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
I think this is due to pip dropping support for python2, see here.
"DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."
I was able to build the image for now by replacing the line that upgrades pip to the latest version on the dockerfile, and installing the previous version on the list instead (20.3.4).
RUN pip install pip==20.3.4
I avoided this problem by using the correct repository for docker-compose setup: https://github.com/cabotapp/docker-cabot