Error importing matplotlib

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Error importing matplotlib

Martin Schimmels
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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Error importing matplotlib

Nathan-2
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 <[hidden email]> 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 "<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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

which IDE ?

vincent_mathoscope
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
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
        ––––––––––––––––––––––––––
                  Vincent Douce
               :=: Mathoscope :=:
             http://mathoscope.xyz
                 06°13°11°07°26
          Bagnères de Bigorre 65200
Reply | Threaded
Open this post in threaded view
|

Re: which IDE ?

Jerzy Karczmarczuk-2

On 17/05/2020 7:01 am, Vincent Douce Mathoscope wrote:

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 ?

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/





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com





_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: which IDE ?

tcaswell
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 

On Sun, May 17, 2020 at 4:22 AM Jerzy Karczmarczuk <[hidden email]> wrote:

On 17/05/2020 7:01 am, Vincent Douce Mathoscope wrote:

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 ?

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/





Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com




_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users


--
Thomas Caswell
[hidden email]

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: which IDE ?

matplotlib - users mailing list
In reply to this post by vincent_mathoscope
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://jupyter.org
https://realpython.com/jupyter-notebook-introduction/
https://jupyterlab.readthedocs.io/en/stable/
https://medium.com/@1522933668924/using-matplotlib-in-jupyter-notebooks-comparing-methods-and-some-tips-python-c38e85b40ba1  (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 -
https://code.visualstudio.com/docs/python/data-science-tutorial
If you are looking for a commercial IDE, the pro version of PyCharm has a scientific mode that displays plots in their own tab -
https://www.jetbrains.com/help/pycharm/matplotlib-support.html
and the Wing IDE can display plots in the IDE -
https://wingware.com/blog/matplotlib

Hope this helps,
Scott

> On May 17, 2020, at 1:01 AM, Vincent Douce Mathoscope <[hidden email]> 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
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users