Skip to content
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

[Bug]: starting error message when importing SpectroChemPy on OSX terminal+ipython and python #713

Open
fernandezc opened this issue Jul 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@fernandezc
Copy link
Collaborator

What happened?

while there is no problem under Jupiter lab, when using OSX terminal+ipython to run spectrochempy, I get this error:

(scpy-base) ➜  ~ ipython
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:10:28) [Clang 15.0.7 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import spectrochempy as scp
Installed osx event loop hook.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
Shell is already running a gui event loop for osx. Call with no arguments to disable the current loop.
SpectroChemPy's API - v.0.6.8
© Copyright 2014-2023 - A.Travert & C.Fernandez @ LCS

Traceback (most recent call last):
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backend_bases.py", line 1226, in _on_timer
    ret = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backends/backend_macosx.py", line 68, in callback_func
    callback()
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backends/backend_macosx.py", line 88, in _draw_idle
    self.draw()
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backends/backend_macosx.py", line 50, in draw
    super().draw()
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backends/backend_agg.py", line 400, in draw
    self.figure.draw(self.renderer)
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/artist.py", line 95, in draw_wrapper
    result = draw(artist, renderer, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
    return draw(artist, renderer)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/figure.py", line 3175, in draw
    mimage._draw_list_compositing_images(
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
    return draw(artist, renderer)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 3064, in draw
    mimage._draw_list_compositing_images(
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
    return draw(artist, renderer)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/text.py", line 752, in draw
    bbox, info, descent = self._get_layout(renderer)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/text.py", line 378, in _get_layout
    _, lp_h, lp_d = _get_text_metrics_with_cache(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/text.py", line 97, in _get_text_metrics_with_cache
    return _get_text_metrics_with_cache_impl(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/text.py", line 105, in _get_text_metrics_with_cache_impl
    return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backends/backend_agg.py", line 233, in get_text_width_height_descent
    font = self._prepare_font(prop)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christian/micromamba/envs/scpy-base/lib/python3.11/site-packages/matplotlib/backends/backend_agg.py", line 270, in _prepare_font
    font.set_size(size, self.dpi)
RuntimeError: In set_size: Could not set the fontsize (invalid pixel size; error code 0x17)

If you suspect this is an IPython 8.14.0 bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

In [2]:

Under terminal+python shell, I get this one:

(scpy-base) ➜  ~ python
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:10:28) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import spectrochempy as scp
SpectroChemPy's API - v.0.6.8
© Copyright 2014-2023 - A.Travert & C.Fernandez @ LCS
>>>  ERROR | RuntimeError: In set_size: Could not set the fontsize (invalid pixel size; error code 0x17)

These errors, do not block the use of SpectroChempy but are quite annoying.

What did you expect to happen?

No error!

Minimal Complete Verifiable Example

No response

Relevant log output

No response

Anything else we need to know?

No response

Environment

latest 0.6.8dev, and previous versions, regardless of python version.

@fernandezc fernandezc added the bug Something isn't working label Jul 20, 2023
@fernandezc fernandezc changed the title [Bug]: [Bug]: starting error message when importing SpectroChemPy on OSX terminal+ipython and python Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant