When I imported matplotlib.plyplot module, I got these errors.
In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The text.latex.preview rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The mathtext.fallback_to_cm rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: Support for setting the 'mathtext.fallback_to_cm' rcParam is deprecated since 3.3 and will be removed two minor releases later; use 'mathtext.fallback : 'cm' instead. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The validate_bool_maybe_none function was deprecated in Matplotlib 3.3 and will be removed two minor releases later. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The savefig.jpeg_quality rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The keymap.all_axes rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The animation.avconv_path rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later. In /home/darklinux/.local/lib/python3.6/site-packages/matplotlib/mpl-data/stylelib/_classic_test.mplstyle: The animation.avconv_args rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later. >>>
When I had this problem I was using Python 3.6.9 (default, Dec 8 2021, 21:08:43) , matplotlib-3.3.4 and Xubuntu 18.04.
To fix this problem, I did 3 steps.
1.Uninstall the Matplotlib module
2.Remove ~/.local/lib/python3.6/site-packages/matplotlib*
3.Reinstall the Matplotlib module
darklinux@darklinuxpc:~$ pip3 uninstall matplotlib Uninstalling matplotlib-3.3.4: /home/darklinux/.local/lib/python3.6/site-packages/__pycache__/pylab.cpython-36.pyc /home/darklinux/.local/lib/python3.6/site-packages/matplotlib-3.3.4-py3.6-nspkg.pth /home/darklinux/.local/lib/python3.6/site-packages/matplotlib-3.3.4.dist-info/INSTALLER /home/darklinux/.local/lib/python3.6/site-packages/matplotlib-3.3.4.dist-info/LICENSE ….. ….. ….. /home/darklinux/.local/lib/python3.6/site-packages/mpl_toolkits/tests/test_axisartist_grid_finder.py /home/darklinux/.local/lib/python3.6/site-packages/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py /home/darklinux/.local/lib/python3.6/site-packages/mpl_toolkits/tests/test_mplot3d.py /home/darklinux/.local/lib/python3.6/site-packages/pylab.py Proceed (y/n)? y Successfully uninstalled matplotlib-3.3.4
darklinux@darklinuxpc:~$ rm -rf ~/.local/lib/python3.6/site-packages/matplotlib*
darklinux@darklinuxpc:~$ pip3 install matplotlib Collecting matplotlib Downloading https://files.pythonhosted.org/packages/09/03/b7b30fa81cb687d1178e085d0f01111ceaea3bf81f9330c937fb6f6c8ca0/matplotlib-3.3.4-cp36-cp36m-manylinux1_x86_64.whl (11.5MB) 100% |████████████████████████████████| 11.5MB 109kB/s Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 (from matplotlib) Downloading https://files.pythonhosted.org/packages/d9/41/d9cfb4410589805cd787f8a82cddd13142d9bf7449d12adf2d05a4a7d633/pyparsing-3.0.8-py3-none-any.whl (98kB) 100% |████████████████████████████████| 102kB 2.6MB/s Collecting kiwisolver>=1.0.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/a7/1b/cbd8ae738719b5f41592a12057ef5442e2ed5f5cb5451f8fc7e9f8875a1a/kiwisolver-1.3.1-cp36-cp36m-manylinux1_x86_64.whl (1.1MB) 100% |████████████████████████████████| 1.1MB 899kB/s Collecting pillow>=6.2.0 (from matplotlib) Downloading https://files.pythonhosted.org/packages/7d/2a/2fc11b54e2742db06297f7fa7f420a0e3069fdcf0e4b57dfec33f0b08622/Pillow-8.4.0.tar.gz (49.4MB) 100% |████████████████████████████████| 49.4MB 26kB/s Collecting python-dateutil>=2.1 (from matplotlib) Downloading https://files.pythonhosted.org/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl (247kB) 100% |████████████████████████████████| 256kB 1.7MB/s Collecting cycler>=0.10 (from matplotlib) Downloading https://files.pythonhosted.org/packages/5c/f9/695d6bedebd747e5eb0fe8fad57b72fdf25411273a39791cde838d5a8f51/cycler-0.11.0-py3-none-any.whl Collecting numpy>=1.15 (from matplotlib) Downloading https://files.pythonhosted.org/packages/45/b2/6c7545bb7a38754d63048c7696804a0d947328125d81bf12beaa692c3ae3/numpy-1.19.5-cp36-cp36m-manylinux1_x86_64.whl (13.4MB) 100% |████████████████████████████████| 13.4MB 96kB/s Collecting six>=1.5 (from python-dateutil>=2.1->matplotlib) Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl Building wheels for collected packages: pillow Running setup.py bdist_wheel for pillow ... done Stored in directory: /home/darklinux/.cache/pip/wheels/a7/69/9a/bba9fca6782340f88dbc378893095722a663cbc618e58fe401 Successfully built pillow Installing collected packages: pyparsing, kiwisolver, pillow, six, python-dateutil, cycler, numpy, matplotlib Successfully installed cycler-0.11.0 kiwisolver-1.3.1 matplotlib-3.3.4 numpy-1.19.5 pillow-8.4.0 pyparsing-3.0.8 python-dateutil-2.8.2 six-1.16.0 darklinux@darklinuxpc:~$
Test.
darklinux@darklinuxpc:~$ python3 Python 3.6.9 (default, Dec 8 2021, 21:08:43) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>>
Problem is fixed now.
Leave a comment