New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libgl to Anaconda docker images #49

Open
nicolashery opened this Issue Jan 29, 2017 · 15 comments

Comments

Projects
None yet
@nicolashery

nicolashery commented Jan 29, 2017

I'm not sure if this is related to the Docker image, conda, or PyQt5, but here is the repro:

docker run -it continuumio/miniconda bash

root@486a15ca93d5:/# conda install pyqt

root@486a15ca93d5:/# 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

root@486a15ca93d5:/# conda list
# packages in environment at /opt/conda:
#
cffi                      1.9.1                    py27_0
conda                     4.3.8                    py27_0
conda-env                 2.6.0                         0
cryptography              1.7.1                    py27_0
dbus                      1.10.10                       0
enum34                    1.1.6                    py27_0
expat                     2.1.0                         0
fontconfig                2.12.1                        2
freetype                  2.5.5                         2
glib                      2.50.2                        1
gst-plugins-base          1.8.0                         0
gstreamer                 1.8.0                         0
icu                       54.1                          0
idna                      2.2                      py27_0
ipaddress                 1.0.18                   py27_0
jpeg                      9b                            0
libffi                    3.2.1                         1
libgcc                    5.2.0                         0
libiconv                  1.14                          0
libpng                    1.6.27                        0
libxcb                    1.12                          1
libxml2                   2.9.4                         0
openssl                   1.0.2h                        1
pcre                      8.39                          1
pip                       8.1.2                    py27_0
pyasn1                    0.1.9                    py27_0
pycosat                   0.6.1                    py27_1
pycparser                 2.17                     py27_0
pycrypto                  2.6.1                    py27_4
pyopenssl                 16.2.0                   py27_0
pyqt                      5.6.0                    py27_2
python                    2.7.12                        1
pyyaml                    3.11                     py27_4
qt                        5.6.2                         3
readline                  6.2                           2
requests                  2.12.4                   py27_0
ruamel_yaml               0.11.14                  py27_0
setuptools                23.0.0                   py27_0
sip                       4.18                     py27_0
six                       1.10.0                   py27_0
sqlite                    3.13.0                        0
tk                        8.5.18                        0
wheel                     0.29.0                   py27_0
yaml                      0.1.6                         0
zlib                      1.2.8                         3

If I downgrade to PyQt4 however, things seem to work:

root@486a15ca93d5:/# conda install pyqt=4
root@486a15ca93d5:/# python -c "from PyQt4 import QtGui"
@nicolashery

This comment has been minimized.

Show comment
Hide comment
@nicolashery

nicolashery Jan 29, 2017

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

nicolashery commented Jan 29, 2017

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
@piec

This comment has been minimized.

Show comment
Hide comment
@piec

piec May 17, 2017

Just install mesa's libgl
apt update
apt install libgl1-mesa-swx11

piec commented May 17, 2017

Just install mesa's libgl
apt update
apt install libgl1-mesa-swx11

@mribbons

This comment has been minimized.

Show comment
Hide comment
@mribbons

mribbons Jun 28, 2017

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

mribbons commented Jun 28, 2017

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

@djfang

This comment has been minimized.

Show comment
Hide comment
@djfang

djfang Jun 29, 2017

For those using yum, it is:
sudo yum install mesa-libGL.x86_64

djfang commented Jun 29, 2017

For those using yum, it is:
sudo yum install mesa-libGL.x86_64

@drcrook1

This comment has been minimized.

Show comment
Hide comment
@drcrook1

drcrook1 Sep 8, 2017

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.

drcrook1 commented Sep 8, 2017

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.

@keisuke-nakata

This comment has been minimized.

Show comment
Hide comment
@keisuke-nakata

keisuke-nakata Oct 5, 2017

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.

keisuke-nakata commented Oct 5, 2017

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.

@jennirinker

This comment has been minimized.

Show comment
Hide comment
@jennirinker

jennirinker May 2, 2018

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

jennirinker commented May 2, 2018

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
@kalefranz

This comment has been minimized.

Show comment
Hide comment
@kalefranz

kalefranz May 2, 2018

Member

@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.

Member

kalefranz commented May 2, 2018

@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.

@mingwandroid

This comment has been minimized.

Show comment
Hide comment
@mingwandroid

mingwandroid May 2, 2018

Member

Yes. Sounds fine to me.

Member

mingwandroid commented May 2, 2018

Yes. Sounds fine to me.

@kalefranz kalefranz changed the title from Installing PyQt5 on miniconda image throws ImportError: libGL.so.1 to add libgl to Anaconda docker images May 2, 2018

@kalefranz kalefranz added this to the anaconda-5.2 milestone May 2, 2018

@mingwandroid

This comment has been minimized.

Show comment
Hide comment
@mingwandroid

mingwandroid May 3, 2018

Member

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).

Member

mingwandroid commented May 3, 2018

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).

@kalefranz

This comment has been minimized.

Show comment
Hide comment
@kalefranz

kalefranz May 3, 2018

Member

though we should use RHEL6/CentOS6 as the base IMHO

Why? Not disagreeing. Just curious what the rational is.

Member

kalefranz commented May 3, 2018

though we should use RHEL6/CentOS6 as the base IMHO

Why? Not disagreeing. Just curious what the rational is.

@mingwandroid

This comment has been minimized.

Show comment
Hide comment
@mingwandroid

mingwandroid May 3, 2018

Member

Because that it the base OS level that we target.

Member

mingwandroid commented May 3, 2018

Because that it the base OS level that we target.

@mbargull

This comment has been minimized.

Show comment
Hide comment
@mbargull

mbargull May 6, 2018

@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.

mbargull commented May 6, 2018

@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.

@mingwandroid

This comment has been minimized.

Show comment
Hide comment
@mingwandroid

mingwandroid May 7, 2018

Member

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.

Member

mingwandroid commented May 7, 2018

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.

@nehaljwani

This comment has been minimized.

Show comment
Hide comment
@nehaljwani

nehaljwani May 7, 2018

Contributor

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.

Contributor

nehaljwani commented May 7, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment