0

I am submitting a script in Python but endedup getting this error:

ImportError Traceback (most recent call last)

~/grader/assignment1_student_solution.py in ()

300 

301 

--> 302 accuracy_plot()

303 

304 

~/grader/assignment1_student_solution.py in accuracy_plot()

248 

249 def accuracy_plot():

--> 250 import matplotlib.pyplot as plt

251 

252     get_ipython().run_line_magic('matplotlib', 'notebook')

/opt/conda/lib/python3.6/site-packages/matplotlib/pyplot.py in ()

113 

114 from matplotlib.backends import pylab_setup

--> 115 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()

116 

117 _IP_REGISTERED = None

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/init.py in pylab_setup()

 30     # imports. 0 means only perform absolute imports.

 31     backend_mod = __import__(backend_name,

---> 32 globals(),locals(),[backend_name],0)

 33 

 34     # Things we pull in from all backends

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py in ()

 14 

 15 from .backend_agg import FigureCanvasAgg

---> 16 from .backend_qt5 import QtCore

 17 from .backend_qt5 import QtGui

 18 from .backend_qt5 import FigureManagerQT

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py in ()

 24 

 25 from matplotlib.widgets import SubplotTool

---> 26 import matplotlib.backends.qt_editor.figureoptions as figureoptions

 27 

 28 from .qt_compat import (QtCore, QtGui, QtWidgets, _getSaveFileName,

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/qt_editor/figureoptions.py in ()

 18 import matplotlib

 19 from matplotlib import cm, markers, colors as mcolors

---> 20 import matplotlib.backends.qt_editor.formlayout as formlayout

 21 from matplotlib.backends.qt_compat import QtGui

 22 

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/qt_editor/formlayout.py in ()

 54 

 55 from matplotlib import colors as mcolors

---> 56 from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore

 57 

 58 

/opt/conda/lib/python3.6/site-packages/matplotlib/backends/qt_compat.py in ()

126     if QT_API == QT_API_PYQT5:

127         try:

--> 128 from PyQt5 import QtCore, QtGui, QtWidgets

129             _getSaveFileName = QtWidgets.QFileDialog.getSaveFileName

130         except ImportError:

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

1
  • 1/ the presentation could be enhanced with a single bloc of code 2/ provide a code snippet recreating the problem. Commented Dec 1, 2021 at 17:43

1 Answer 1

0

It seems that you are missing libGL.so.

libGL.so can be found in many packages depending on your graphic card. See here

Choose the package that is suited for your graphic card and install it using:

sudo apt-get install <package-name>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.