[Matplotlib-users] Error importing matplotlib

Hi,
I wonder what's happening:
(OS: OpenSuSE Linux Leap 15.1; Python 3.6.10; matplotlib-2.0.2-py3.6)

···

================
~> python
Python 3.6.10 (default, Jan 16 2020, 09:12:04) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/matplotlib/__init__.py", line
122, in <module>
    from matplotlib.cbook import is_string_like, mplDeprecation, dedent,
get_label
ImportError: cannot import name 'is_string_like'

Worked 2 weeks ago. Changes on my system: installed a venv, removed it.

Greetings
Martin
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

It looks like you have two different matplotlib versions simultaneously installed somehow, is_string_like was removed in matplotlib 3.0.

Probably the easiest way to fix this is just to blow away the virtualenv.

···

On Sat, May 16, 2020 at 7:56 AM Martin Schimmels <martin.schimmels@web.de> wrote:

Hi,
I wonder what’s happening:
(OS: OpenSuSE Linux Leap 15.1; Python 3.6.10; matplotlib-2.0.2-py3.6)

================
~> python
Python 3.6.10 (default, Jan 16 2020, 09:12:04) [GCC] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import matplotlib.pyplot as plt
Traceback (most recent call last):
File “”, line 1, in
File “/usr/lib64/python3.6/site-packages/matplotlib/init.py”, line
122, in
from matplotlib.cbook import is_string_like, mplDeprecation, dedent,
get_label
ImportError: cannot import name ‘is_string_like’
================

Worked 2 weeks ago. Changes on my system: installed a venv, removed it.

Greetings
Martin


Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

hi
when i am creating Matplotlib figures
i edit the python code in some text editor
then i run it in the temrinal
then the picture appears in an external app whose icon is a rocket
then to modify the code and see the result i have to close the rocket window etc..
it is not so fluid as protocol
my question is :
do you use any IDE more ergonomic than my protocol ?
thanks
Vincent

···

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

Dozens, or so.

But if you don’t even tell your readers which platform, which system are you using, which Python distribution, etc.,
our friend Harry Potter, and we other dark magicians might have problems with proposing you an adequate magic.

Jerzy Karczmarczuk
/Caen, France/

···
when i am creating Matplotlib figures
i edit the python code in some text editor
then i run it in the temrinal
then the picture appears in an external app whose icon is a rocket
then to modify the code and see the result i have to close the rocket window etc..
it is not so fluid as protocol
my question is :
**do you use any IDE more ergonomic than my protocol ?**

As this is an international and text-based mailing list please I am not sure that (what I am assuming is good natured) humor will always translate, please keep the discussion here professional.

There are a number of IDE / editors (emacs, vscode, pycharm, jupyterlab, …) that allow you to have a running (I)Python session that you send your code to be evaluated in a continuously running session. If you put use pyplots “interactive” mode your windows will stay open and you can keep re-evaluating (parts of) your code until you are happy. Personally I use emacs + org-mode + IPython in this way.

Best of luck!

Tom

···

Thomas Caswell
tcaswell@gmail.com

Hi Vincent,

You may want to try Jupyter notebooks or Jupyterlab with the %matplotlib magics. You can modify the code in a cell, re-run it and see the updated plot in the notebook window. When you're happy with the results, copy-paste the code into a .py file for use outside of the notebook. Here are a few links in case you are not familiar with Jupiter

https://jupyterlab.readthedocs.io/en/stable/
Using matplotlib in jupyter notebooks — comparing methods and some tips [Python] | by Medium One | Medium (April 2018)
https://www.youtube.com/watch?v=7jiPeIFXb6U&list=PL055Epbe6d5b572IRmYAHkUgcq3y6K3Ae&index=32&t=0s (Joel Grus "I Don't Like Notebooks" talk at 2018 Jupytercon)

The free Visual Studio Code IDE supports Jupyter notebooks and can display Matplotlib plots in the IDE -

If you are looking for a commercial IDE, the pro version of PyCharm has a scientific mode that displays plots in their own tab -

and the Wing IDE can display plots in the IDE -

Hope this helps,
Scott

···

On May 17, 2020, at 1:01 AM, Vincent Douce Mathoscope <mathoscope@netcourrier.com> wrote:

hi
when i am creating Matplotlib figures
i edit the python code in some text editor
then i run it in the temrinal
then the picture appears in an external app whose icon is a rocket
then to modify the code and see the result i have to close the rocket window etc..
it is not so fluid as protocol
my question is :
do you use any IDE more ergonomic than my protocol ?
thanks
Vincent
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
Matplotlib-users Info Page

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users