Error on build docker image: unable to collect setuptools
gmmephisto opened this issue · comments
Mikhail Ushanov commented
Got an error on building latest docker image with yandex-tank:
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/2f/8e/38259f4a44944a92068d5ff77230511a4c685604b47a81318f9e5cf2cc24/setuptools-49.2.0.zip (2.2MB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "setuptools/__init__.py", line 21, in <module>
import setuptools.version
File "setuptools/version.py", line 1, in <module>
import pkg_resources
File "pkg_resources/__init__.py", line 1380
raise SyntaxError(e) from e
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-PzQxmO/setuptools/
You are using pip version 8.1.1, however version 20.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -yq --no-install-recommends ${BUILD_DEPS} && pip install --upgrade setuptools && pip install --upgrade pip==9.0.3 && pip install https://api.github.com/repos/yandex/yandex-tank/tarball/${BRANCH} && apt-get autoremove -y ${BUILD_DEPS} && apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/* /root/.cache/*' returned a non-zero code: 1
Steps to reproduce:
cd docker/
docker build .
Possible fix:
- It would be better to install the latest pip using
get-pip.py
script fromhttps://bootstrap.pypa.io/
using a python2 interpreter.
Mark commented
+1 on this one
Slusarenko Igor commented
The following solution solves the problem. In a dockerfile Place:
pip install --upgrade pip==9.0.3
Above:
pip install --upgrade setuptools
It needs to be like this:
...
pip install --upgrade pip==9.0.3 && \
pip install --upgrade setuptools && \
...
Andrey Selivanov commented
It needs to be like this:
... pip install --upgrade pip==9.0.3 && \ pip install --upgrade setuptools && \ ...
It works on develop branch and does not work on master, anyway thanks for help
zhangguanzhang commented
apt-get install python python-pip
pip install --no-cache-dir setuptools==20.7.0
pip install xxx