Python Forum

Full Version: matplotlib textbox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.


hi, I'm trying to get a textbox to work in matplotlib but I keep getting the following error: 
Traceback (most recent call last):
  File ".../mplExample.py", line 3, in <module>
    from matplotlib.widgets import TextBox
ImportError: cannot import name 'TextBox'

And I get this error using the code matplotlib provides here: https://matplotlib.org/2.1.0/gallery/wid...xtbox.html 
does anyone know a workaround? in my code from matplotlib.widgets import Slider, Button works but TextBox doesn't
It works fine for me.
Try copy and paste once more, using shift-ctrl-v for the paste.

If using windows:
If it still fails, uninstall matplotlib and reinstall using the wheel here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
the naming for the correct module is:
matplotlib‑2.1.0‑cp36‑cp36m‑win_amd64.whl
where xx is python version (like '36' for 3.6.3), and yy = windows '32' or '64' 'address bits'
TextBox was added in 2.1,which a the latest release so you need to update.
Thanks Larz60+ that solved it