Open nicolashery opened 7 years ago
I've tried using another miniconda Docker image, and I'm getting the same error. So this might not be an issue with the image. Do let me know if you have any ideas though.
docker run -it show0k/alpine-miniconda bash
bash-4.3$ conda install pyqt
bash-4.3$ python -c "from PyQt5 import QtGui"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Just install mesa's libgl apt update apt install libgl1-mesa-swx11
for me
$ sudo apt install libgl1-mesa-glx
was the solution.
$ conda list | grep qt
pyqt 5.6.0 py27_2
qt 5.6.2 4
qtawesome 0.4.4 py27_0
qtpy 1.2.1 py27_0
Ubuntu 16.04.2
For those using yum, it is:
sudo yum install mesa-libGL.x86_64
I am using python 3 and none of these solutions appear to work. I have a dependency on matplotlib.pyplot and am using a container that is hidden from me that I believe is based on one of these.
I have the same problem.
docker run -it continuumio/anaconda3:5.0.0 /bin/bash
> python -c "import matplotlib.pyplot as plt; fig=plt.Figure(); fig.savefig('foo.png')"
just throws error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/conda/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/opt/conda/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 16, in <module>
from .backend_qt5 import QtCore
File "/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py", line 26, in <module>
import matplotlib.backends.qt_editor.figureoptions as figureoptions
File "/opt/conda/lib/python3.6/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in <module>
import matplotlib.backends.qt_editor.formlayout as formlayout
File "/opt/conda/lib/python3.6/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in <module>
from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
File "/opt/conda/lib/python3.6/site-packages/matplotlib/backends/qt_compat.py", line 128, in <module>
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
And
docker run -it continuumio/anaconda3:5.0.0 /bin/bash
> python -c "import matplotlib as mpl; mpl.use('Agg'); import matplotlib.pyplot as plt; fig=plt.Figure(); fig.savefig('foo.png')"
throws error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/conda/lib/python3.6/site-packages/matplotlib/figure.py", line 1573, in savefig
self.canvas.print_figure(*args, **kwargs)
AttributeError: 'NoneType' object has no attribute 'print_figure'
It seems that the anaconda3:5.0.0 docker container misses matplotlib support.
This workaround (which was mentioned above) worked for me today on the latest anaconda3 docker image. These are the lines I added near the top of my dockerfile.
RUN apt-get update && \
apt-get install libgl1-mesa-glx -y
@mingwandroid Do you think it makes sense to include libgl in these Docker images? I'm thinking the extra weight makes sense for the Anaconda images, but not for Miniconda.
Yes. Sounds fine to me.
We should also add: libgl1-mesa-glx mesa-libGL libXcomposite libXcursor libXi libXtst libXScrnSaver libXrandr alsa-lib mesa-libEGL
(or the debian equivalents, though we should use RHEL6/CentOS6 as the base IMHO).
though we should use RHEL6/CentOS6 as the base IMHO
Why? Not disagreeing. Just curious what the rational is.
Because that it the base OS level that we target.
@mingwandroid, is there some kind of official document stating all base requirements for anaconda
? https://docs.anaconda.com/anaconda/install/#system-requirements only gives
Linux, including Ubuntu, RedHat, CentOS 6+, and others
without stating any additional libraries.
It's always been an implicit requirement that a Linux system requires the 'normal' desktop stack to run Anaconda (but not Miniconda).
Qt 5.9 brings in a lot more of these due to chromium. Yes, we need to make that explicit though and provide better instructions for the most common distros, perhaps even checking in the AD install script (for now?). Ping @csoja and @nehaljwani.
Also now that we have identified CDT packages in our recipes we should be able to have conda recommend what system packages to install and how to install them when it finds them missing. The CDT packages are not known to the solver though but we could have conda look at the rendered recipe for this, perhaps? You'd need a mapping from the CentOS6 packages names to other distro packages names somewhere too.
I second @mingwandroid and yes, it would be nice to have the docs mention the low level system deps for popular distros for being able to use all the conda packages provided in the anaconda installer.
thanks, @djfang. it worked for me.
I'm not sure if this is related to the Docker image, conda, or PyQt5, but here is the repro:
If I downgrade to
PyQt4
however, things seem to work: