M-Alejo / fieldStats

A QGIS pluggin for calculate field stats and make a histogram and boxplot for numeric fields in vector layers
Other
0 stars 0 forks source link

'seaborn-v0_8-whitegrid' not found in the style library #1

Open caprieldeluca opened 6 days ago

caprieldeluca commented 6 days ago

Hi, I was trying to test the plugin, and returned the following error:

Traceback (most recent call last):
              File "/usr/lib/python3/dist-packages/matplotlib/style/core.py", line 127, in use
              rc = rc_params_from_file(style, use_default_template=False)
              File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 856, in rc_params_from_file
              config_from_file = _rc_params_in_file(fname, fail_on_error=fail_on_error)
              File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 782, in _rc_params_in_file
              with _open_file_or_url(fname) as fd:
              File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
              return next(self.gen)
              File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 759, in _open_file_or_url
              with open(fname, encoding=encoding) as f:
             FileNotFoundError: [Errno 2] No such file or directory: 'seaborn-v0_8-whitegrid'

             The above exception was the direct cause of the following exception:

             Traceback (most recent call last):
              File "/home/gabriel/.local/share/QGIS/QGIS3/profiles/334/python/plugins/field_stats/field_stats.py", line 292, in btn_calcular_click
              self.actualizar_grafica()
              File "/home/gabriel/.local/share/QGIS/QGIS3/profiles/334/python/plugins/field_stats/field_stats.py", line 388, in actualizar_grafica
              self.agregar_grafica()
              File "/home/gabriel/.local/share/QGIS/QGIS3/profiles/334/python/plugins/field_stats/field_stats.py", line 367, in agregar_grafica
              plt.style.use('seaborn-v0_8-whitegrid')
              File "/usr/lib/python3/dist-packages/matplotlib/style/core.py", line 130, in use
              raise IOError(
             OSError: 'seaborn-v0_8-whitegrid' not found in the style library and input is not a valid URL or path; see `style.available` for list of available styles

About QGIS:

       
QGIS version 3.34.7-Prizren QGIS code revision 6f7d735cae3
Qt version 5.15.3
Python version 3.10.12
GDAL/OGR version 3.4.1
PROJ version 8.2.1
EPSG Registry database version v10.041 (2021-12-03)
GEOS version 3.10.2-CAPI-1.16.0
SQLite version 3.37.2
PDAL version 2.3.0
PostgreSQL client version 14.11 (Ubuntu 14.11-0ubuntu0.22.04.1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Ubuntu 22.04.4 LTS
       

Active Python plugins quick_map_services | 0.19.34 puentes | 1.1.0 db_manager | 0.1.20 processing | 2.12.99

About Python and matplotlib:

gabriel@mymachine:~$ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'3.5.1'
>>> import matplotlib.pyplot as plt
>>> plt.style.available
['Solarize_Light2', '_classic_test_patch', '_mpl-gallery', '_mpl-gallery-nogrid', 'bmh', 'classic', 'dark_background', 'fast', 'fivethirtyeight', 'ggplot', 'grayscale', 'seaborn', 'seaborn-bright', 'seaborn-colorblind', 'seaborn-dark', 'seaborn-dark-palette', 'seaborn-darkgrid', 'seaborn-deep', 'seaborn-muted', 'seaborn-notebook', 'seaborn-paper', 'seaborn-pastel', 'seaborn-poster', 'seaborn-talk', 'seaborn-ticks', 'seaborn-white', 'seaborn-whitegrid', 'tableau-colorblind10']

Regards, Gabriel

Workspace 1_001

M-Alejo commented 6 days ago

Hi Gabriel, thanks for the comment,

I'm goin to make a change because it depends on matplotlib version. But in mean time you can make this: 1) Go to the plugin folder, in File "/home/gabriel/.local/share/QGIS/QGIS3/profiles/334/python/plugins/field_stats 2) Open the field_stats.py file 3) Go to the line 367 and add a # symbol in the begining to comment that line. 4) Add a new line with the next text: plt.style.use('seaborn-whitegrid') It may look like this: imagen 5) Save the change and restart QGIS

caprieldeluca commented 6 days ago

It worked that way. Thank you!