Thanks to visit codestin.com
Credit goes to github.com

Skip to content

matplotlib import fails #15167

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

Closed
aamster opened this issue Sep 1, 2019 · 5 comments
Closed

matplotlib import fails #15167

aamster opened this issue Sep 1, 2019 · 5 comments

Comments

@aamster
Copy link

aamster commented Sep 1, 2019

Bug report

Bug summary

import matplotlib.pyplot fails with 'property' object has no attribute '__name__'

Code for reproduction

import matplotlib.pyplot

Matplotlib version

  • Operating system: mac osx
  • Matplotlib version: '3.0.3'
  • Python version: 3.7.1

Installed via conda

stack trace

  File "<ipython-input-115-864e826dab68>", line 1, in <module>
    import matplotlib.pyplot
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/adamamster/anaconda3/envs/py37/lib/python3.7/site-packages/matplotlib/pyplot.py", line 32, in <module>
    import matplotlib.colorbar
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/adamamster/anaconda3/envs/py37/lib/python3.7/site-packages/matplotlib/colorbar.py", line 27, in <module>
    import matplotlib.artist as martist
  File "/Applications/PyCharm CE.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "/Users/adamamster/anaconda3/envs/py37/lib/python3.7/site-packages/matplotlib/artist.py", line 57, in <module>
    class Artist(object):
  File "/Users/adamamster/anaconda3/envs/py37/lib/python3.7/site-packages/matplotlib/artist.py", line 64, in Artist
    @property
  File "/Users/adamamster/anaconda3/envs/py37/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 182, in deprecate
AttributeError: 'property' object has no attribute '__name__'
@tacaswell
Copy link
Member

I don't immediately see how this is connected to #15159 This looks closer to a comment in #13673 but I don't understand how they are related yet.

I just tried installing py3.7 + mpl3.0.3 with both conda and pip and could not reproduce this (I am on linux and not in pycharm).

Can you reproduce this error not in pycharm?

@tacaswell
Copy link
Member

and can you also try updating to 3.1.1?

@aamster aamster closed this as completed Sep 1, 2019
@aamster
Copy link
Author

aamster commented Sep 1, 2019

@tacaswell works after restarting pycharm. Sorry to bother you.

@eshwarkamal
Copy link

eshwarkamal commented May 10, 2020

(base) C:\Windows\system32>activate cv

(cv) C:\Windows\system32>python
Python 3.6.8 |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
import matplotlib.pyplot as plt
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\91741\AppData\Roaming\Python\Python36\site-packages\matplotlib\pyplot.py", line 32, in
import matplotlib.colorbar
File "C:\Users\91741\AppData\Roaming\Python\Python36\site-packages\matplotlib\colorbar.py", line 27, in
import matplotlib.artist as martist
File "C:\Users\91741\AppData\Roaming\Python\Python36\site-packages\matplotlib\artist.py", line 57, in
class Artist(object):
File "C:\Users\91741\AppData\Roaming\Python\Python36\site-packages\matplotlib\artist.py", line 64, in Artist
@Property
File "C:\Users\91741\AppData\Roaming\Python\Python36\site-packages\matplotlib\cbook\deprecation.py", line 182, in deprecate
name = obj.name
AttributeError: 'property' object has no attribute 'name'

@tacaswell please help this, i have tired lot.
dwe

@tacaswell
Copy link
Member

Looking at the original post again, they report being on mpl 3.0.3, but the line raising was added in 3.1.0. My suspicion is that there are overlapping installations and some files are from one version of mpl and other are from another. It is not surprising that this leads to things not working in really weird ways.

@eshwarkamal Can you please open a topic at https://discourse.matplotlib.org/c/community/install/13 ? Make sure to include what OS you are on, how you installed Python, how you installed Maplotlib and the versions of everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants