开发者社区> 问答> 正文

centOS7 python matplotlib.pyplot 出现错误

mafia0 2017-11-20 18:39:52 2102

import matplotlib.pyplot as plt
File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.py", line 113, in

_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()

File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 60, in pylab_setup

[backend_name], 0)

File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 16, in

from .backend_qt5 import (

File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 18, in

import matplotlib.backends.qt_editor.figureoptions as figureoptions

File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/backends/qt_editor/figureoptions.py", line 20, in

import matplotlib.backends.qt_editor.formlayout as formlayout

File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/backends/qt_editor/formlayout.py", line 56, in

from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore

File "/root/anaconda2/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py", line 137, in

from PyQt5 import QtCore, QtGui, QtWidgets

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Linux Python
分享到
取消 提交回答
全部回答(1)
  • 洵云
    2019-07-17 21:44:33

    需要安装gl库,用下面的命令试一下:
    $ sudo apt-get install git-core gnupg flex bison gperf build-essential \
    zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
    libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
    libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
    python-markdown libxml2-utils xsltproc zlib1g-dev:i386
    $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

    0 0

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题