turlucode/ros-docker-gui

Make cpu_ros_melodic fails no pip<21

Closed this issue · 4 comments

OK, I'm trying to build the cpu version of melodic, but this dockerfile is failing in the paramiko installation, it is looking for pip<21 to install virtualenv

But the build says there is no pip version under 21

The dockerfile in ./cpu/melodic/base/Dockerfile

RUN /usr/bin/yes | pip install --upgrade "pip < 21.0"
RUN /usr/bin/yes | pip install --upgrade virtualenv
RUN /usr/bin/yes | pip install --upgrade paramiko

And I'm pretty sure that there is a version pinning problem here. Sigh Python 2.7 support sucks!

OK, I'm not sure why pip was pinned that low with v22 running, but I removed this and Paramiko needs some apt-get packages installed.

You might want to consider installing some github actions which will run all the dockerfiles and also pushing them into dockerhub (as this is free for open source), so people can just pull them rather than building their own. I can help with that if you like

OK, I'm trying to build the cpu version of melodic, but this dockerfile is failing in the paramiko installation, it is looking for pip<21 to install virtualenv

But the build says there is no pip version under 21

The dockerfile in ./cpu/melodic/base/Dockerfile

RUN /usr/bin/yes | pip install --upgrade "pip < 21.0"
RUN /usr/bin/yes | pip install --upgrade virtualenv
RUN /usr/bin/yes | pip install --upgrade paramiko

And I'm pretty sure that there is a version pinning problem here. Sigh Python 2.7 support sucks!

Hello richtong. I just built successfully the cpu_ros_melodic version:

make cpu_ros_melodic

This is the part of the terminal for me for the pip packages installation

Step 12/41 : RUN /usr/bin/yes | pip install --upgrade "pip < 21.0"
 ---> Running in 8d06d2a66232
Collecting pip<21.0
  Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, outside environment /usr
Successfully installed pip-20.3.4
Removing intermediate container 8d06d2a66232
 ---> 8fc693c8196e
Step 13/41 : RUN /usr/bin/yes | pip install --upgrade virtualenv
 ---> Running in 8b7f5ecb07a7
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.
Collecting virtualenv
  Downloading virtualenv-20.14.1-py2.py3-none-any.whl (8.8 MB)
Collecting pathlib2<3,>=2.3.3; python_version < "3.4" and sys_platform != "win32"
  Downloading pathlib2-2.3.7.post1-py2.py3-none-any.whl (18 kB)
Collecting filelock<4,>=3.2
  Downloading filelock-3.2.1-py2.py3-none-any.whl (9.3 kB)
Collecting importlib-metadata>=0.12; python_version < "3.8"
  Downloading importlib_metadata-2.1.3-py2.py3-none-any.whl (10 kB)
Collecting importlib-resources>=1.0; python_version < "3.7"
  Downloading importlib_resources-3.3.1-py2.py3-none-any.whl (26 kB)
Collecting platformdirs<3,>=2
  Downloading platformdirs-2.0.2-py2.py3-none-any.whl (10 kB)
Requirement already satisfied, skipping upgrade: six<2,>=1.9.0 in /usr/lib/python2.7/dist-packages (from virtualenv) (1.11.0)
Collecting distlib<1,>=0.3.1
  Downloading distlib-0.3.4-py2.py3-none-any.whl (461 kB)
Collecting typing; python_version < "3.5"
  Downloading typing-3.10.0.0-py2-none-any.whl (26 kB)
Collecting scandir; python_version < "3.5"
  Downloading scandir-1.10.0.tar.gz (33 kB)
Collecting contextlib2; python_version < "3"
  Downloading contextlib2-0.6.0.post1-py2.py3-none-any.whl (9.8 kB)
Collecting zipp>=0.5
  Downloading zipp-1.2.0-py2.py3-none-any.whl (4.8 kB)
Collecting configparser>=3.5; python_version < "3"
  Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
Collecting singledispatch; python_version < "3.4"
  Downloading singledispatch-3.7.0-py2.py3-none-any.whl (9.2 kB)
Building wheels for collected packages: scandir
  Building wheel for scandir (setup.py): started
  Building wheel for scandir (setup.py): finished with status 'done'
  Created wheel for scandir: filename=scandir-1.10.0-cp27-cp27mu-linux_x86_64.whl size=36333 sha256=bc455622760210eeecb1e44577f93735332a546d977ca05e35561252bfbb0f9c
  Stored in directory: /root/.cache/pip/wheels/58/2c/26/52406f7d1f19bcc47a6fbd1037a5f293492f5cf1d58c539edb
Successfully built scandir
Installing collected packages: typing, scandir, pathlib2, filelock, contextlib2, zipp, configparser, importlib-metadata, singledispatch, importlib-resources, platformdirs, distlib, virtualenv
Successfully installed configparser-4.0.2 contextlib2-0.6.0.post1 distlib-0.3.4 filelock-3.2.1 importlib-metadata-2.1.3 importlib-resources-3.3.1 pathlib2-2.3.7.post1 platformdirs-2.0.2 scandir-1.10.0 singledispatch-3.7.0 typing-3.10.0.0 virtualenv-20.14.1 zipp-1.2.0
Removing intermediate container 8b7f5ecb07a7
 ---> eaeb6ca1354c
Step 14/41 : RUN /usr/bin/yes | pip install --upgrade paramiko
 ---> Running in 7b76a8138c53
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.
Collecting paramiko
  Downloading paramiko-2.11.0-py2.py3-none-any.whl (212 kB)
Collecting cryptography>=2.5
  Downloading cryptography-3.3.2-cp27-cp27mu-manylinux2010_x86_64.whl (2.6 MB)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python2.7/dist-packages (from paramiko) (1.11.0)
Collecting pynacl>=1.0.1
  Downloading PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl (964 kB)
Collecting bcrypt>=3.1.3
  Downloading bcrypt-3.1.7-cp27-cp27mu-manylinux1_x86_64.whl (59 kB)
Requirement already satisfied, skipping upgrade: ipaddress; python_version < "3" in /usr/lib/python2.7/dist-packages (from cryptography>=2.5->paramiko) (1.0.17)
Collecting cffi>=1.12
  Downloading cffi-1.15.0-cp27-cp27mu-manylinux1_x86_64.whl (393 kB)
Requirement already satisfied, skipping upgrade: enum34; python_version < "3" in /usr/lib/python2.7/dist-packages (from cryptography>=2.5->paramiko) (1.1.6)
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: pycparser, cffi, cryptography, pynacl, bcrypt, paramiko
  Attempting uninstall: cryptography
    Found existing installation: cryptography 2.1.4
    Uninstalling cryptography-2.1.4:
      Successfully uninstalled cryptography-2.1.4
Successfully installed bcrypt-3.1.7 cffi-1.15.0 cryptography-3.3.2 paramiko-2.11.0 pycparser-2.21 pynacl-1.4.0
Removing intermediate container 7b76a8138c53
 ---> 108887fb108a
Step 15/41 : RUN /usr/bin/yes | pip install --ignore-installed --upgrade numpy protobuf
 ---> Running in 8ffe194b1a8c
/usr/lib/python2.7/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.utils import int_from_bytes
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.
Collecting numpy
  Downloading numpy-1.16.6-cp27-cp27mu-manylinux1_x86_64.whl (17.0 MB)
Collecting protobuf
  Downloading protobuf-3.17.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
Collecting six>=1.9
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: numpy, six, protobuf
Successfully installed numpy-1.16.6 protobuf-3.17.3 six-1.16.0
Removing intermediate container 8ffe194b1a8c
 ---> 1e7aff08da70

I remember the EOL of pyhton 2.7 gave us a lot of issues. After looking around and trying to overcome the pip issues, we ended up constraining the pip to "pip < 21.0". We should have documented why, cause now, I really don't remember how we ended up with that solution (see commit def1aa7).

What was the error you were getting?

Probably this is why we decided to use pip install --upgrade "pip < 21.0": https://stackoverflow.com/questions/65558034/cant-install-pip-anymore-with-python-2-7

OK, I'm trying to build the cpu version of melodic, but this dockerfile is failing in the paramiko installation, it is looking for pip<21 to install virtualenv

But the build says there is no pip version under 21

The dockerfile in ./cpu/melodic/base/Dockerfile

RUN /usr/bin/yes | pip install --upgrade "pip < 21.0"
RUN /usr/bin/yes | pip install --upgrade virtualenv
RUN /usr/bin/yes | pip install --upgrade paramiko

And I'm pretty sure that there is a version pinning problem here. Sigh Python 2.7 support sucks!

I quickly checked the changes you propose, although this builds, inside the container you get

pip --version
/usr/lib/python2.7/dist-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography import x509
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

So I am gonna keep the original file since I cannot reproduce it.