Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
matplotlib textbox
#1


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
Reply
#2
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'
Reply
#3
TextBox was added in 2.1,which a the latest release so you need to update.
Reply
#4
Thanks Larz60+ that solved it
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Matplotlib: How do I convert Dates from Excel to use in Matplotlib JaneTan 1 3,243 Mar-11-2021, 10:52 AM
Last Post: buran
  Take particular symbol from textbox help samuelbachorik 3 2,174 Apr-14-2020, 03:55 AM
Last Post: steve_shambles
  add a textbox in an image Akhou 17 10,962 May-23-2018, 09:07 AM
Last Post: Akhou
  Print func textbox instead of shell zykbee 1 5,255 Dec-06-2017, 08:22 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020