textual: error when running examples

i installed textual with pip and i tried to run the first example in the readme with python3 filename.py but i get the error TypeError: on_key() takes 1 positional argument but 2 were given when i press a key. got a similiar error with another example. sorry if im being dumb : p

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16

Most upvoted comments

If you have textual installed via pip, you will need to first uninstall it and then install it via Poetry.

Uninstall it with this:

pip uninstall textual

Now cd in to the textual directory and run the following:

poetry install

The bleeding edge version of Textual will now be installed and you can run the examples with the following:

python animation.py

@cole-wilson You can use the version on PyPi just by adding textual to your project. These instructions are so you can try out the latest code before it is released.

@prolomix You will need to get the latest code from the repository (here). You can do this by cloning the repos. Click the code tab above and then the green Code button.

Screen Shot 2021-09-01 at 09 11 42

If you have never done this before, see if you can find a guide online.