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

error when running examples #71

Closed
itsUrcute opened this issue Aug 24, 2021 · 16 comments
Closed

error when running examples #71

itsUrcute opened this issue Aug 24, 2021 · 16 comments

Comments

@itsUrcute
Copy link

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

@willmcgugan
Copy link
Collaborator

You will need to install via poetry. Do 'pip uninstall textual' then 'poetry install' before running the examples...

@itsUrcute
Copy link
Author

sorry im kinda new to python so i may be messing something up. i did python3 -m poetry add textual and now its telling me textual isnt a module. the pyproject.toml file and poetry.lock file both add up though

the error is

from textual.app import App
ModuleNotFoundError: No module named 'textual'

@itsUrcute
Copy link
Author

so i did poetry run python filename.py and got the initial error TypeError: on_key() takes 1 positional argument but 2 were given. would appreciate some help on this

@cole-wilson
Copy link

I am also having trouble with this exact same error. Running python3 -m textual.app runs the demo just fine, but running the examples failed. I have installed everything with poetry.

@willmcgugan
Copy link
Collaborator

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
Copy link

Ah, okay! I was trying to just do poetry add textual and then poetry install in an empty directory. yiur directions work great!

As I understand it however, that will only install textual in a virtual environment for the textual source. Is there a way I can install it globally to use with other projects? I normally don't use poetry, so please forgive me if this is a simple question.

Textual is a really cool project and I'm loving the examples, thank you souch for all the work you put into it!

@prolomix
Copy link

prolomix commented Sep 1, 2021

Please help I did what you said but Visual Studio tells me " There is no module called 'textual'."
then I uninstall 'textual' and Now cd into the textual directory and run the following: poetry installs and cmd pop up with an error.
tempsnip
#71

@willmcgugan
Copy link
Collaborator

@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.

@prolomix
Copy link

prolomix commented Sep 1, 2021

I did it and it shows the same
but I run test file and it showed me this:
Untitled

@prolomix
Copy link

prolomix commented Sep 1, 2021

I did it and it shows me this in test file:
Untitled

what does this mean

@willmcgugan
Copy link
Collaborator

Ah. You are running on Windows. Textual is not yet compatible with Windows I'm afraid.

@prolomix
Copy link

prolomix commented Sep 1, 2021

Ok @willmcgugan

@prolomix
Copy link

prolomix commented Sep 1, 2021

When it will be available for windows

@willmcgugan
Copy link
Collaborator

Can't say for certain, but I would suspect a month or two.

@cole-wilson
Copy link

@willmcgugan thanks!

@github-actions
Copy link

Did I solve your problem?

Consider sponsoring my work on Textual with a monthly donation.

Or buy me a coffee to say thanks.

Will McGugan

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

4 participants