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

Import error: cannot import _cntr #13

Closed
woolgathering opened this issue Mar 25, 2018 · 2 comments
Closed

Import error: cannot import _cntr #13

woolgathering opened this issue Mar 25, 2018 · 2 comments

Comments

@woolgathering
Copy link

Getting this error on trying to import visbrain:

>>> import visbrain
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/visbrain/__init__.py", line 23, in <module>
    from .brain import Brain
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/visbrain/brain/__init__.py", line 2, in <module>
    from .brain import Brain
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/visbrain/brain/brain.py", line 11, in <module>
    import vispy.scene.cameras as viscam
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/vispy/scene/__init__.py", line 33, in <module>
    from .visuals import *  # noqa
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/vispy/scene/visuals.py", line 18, in <module>
    from .. import visuals
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/vispy/visuals/__init__.py", line 23, in <module>
    from .isocurve import IsocurveVisual  # noqa
  File "/home/roger/Documents/jacob/pieces/eoiayidbyII/eoiaw/lib/python3.6/site-packages/vispy/visuals/isocurve.py", line 18, in <module>
    from matplotlib import _cntr as cntr
ImportError: cannot import name '_cntr'

I'm on Python 3.6.5rc1, all packages installed today from pip. In my poking around I found this: https://stackoverflow.com/questions/49160142/how-should-cntr-should-be-imported-on-matplotlib-lts-2-2-0 Must one use an old version of matplotlib?

@EtienneCmb
Copy link
Owner

EtienneCmb commented Mar 25, 2018

Hello @woolgathering , thanks for your feedback. Indeed, this issue is related to the _cntr module of matplotlib.

  • If you need to draw isocurve, like levels on topotplot (see top left and top right plot), you can use an older version of matplotlib
  • If not, and if you want to have the latest matplotlib version, I suggest to install vispy from github and not from pip. There's a "patch" for this issue

@woolgathering
Copy link
Author

Got it; I'll install vispy from github as I don't need isocurve.

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

2 participants