matplotlib for ROS
I am building a docker container for using ROS.
I build and run the container and I wanted to use rqt_plot. To do this I had to install it with
$ sudo apt-get install ros-kinetic-rqt
$ sudo apt-get install ros-kinetic-rqt-common-plugins
However, this won't run rqt_plot due to the lack of matplotlib as explained in this answer
So I installed matplotlib with
python -m pip install -U pip
python -m pip install -U matplotlib
but I had to do
apt-get -y install python-pip
first. After that it worked.
Now I wanted to put all that in the dockerfile for next time but for some reason it fails. In the end I managed to install matplotlib from the docker file but now I get
Step 7/9 : RUN python -m pip install -U matplotlib
---> Running in 2021b190548b
Collecting matplotlib
Downloading https://files.pythonhosted.org/packages/9c/4b/06f4aa9bef6b5e4f177881b4dedd94faa6e7cb3d95dfaeaa8a1a8b541095/matplotlib-3.2.2.tar.gz (40.3MB)
Complete output from command python setup.py egg_info:
Beginning with Matplotlib 3.1, Python 3.6 or above is required.
You are using Python 2.7.12.
This may be due to an out of date pip.
Make sure you have pip >= 9.0.1.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-MZvL14/matplotlib/
You are using pip version 8.1.1, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c python -m pip install -U matplotlib' returned a non-zero code: 1
non-network local connections being added to access control list
So, it is installing matplotlib that uses python3 but ROS uses python2
I wonder why it worked when I did it inside the container and the main question How can I install matplotlib to use with ROS (python2) so that I can use rqt_plot?