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

No module named 'readline' #20

Closed
stuart-thomas-zoopla opened this issue Feb 16, 2024 · 3 comments
Closed

No module named 'readline' #20

stuart-thomas-zoopla opened this issue Feb 16, 2024 · 3 comments

Comments

@stuart-thomas-zoopla
Copy link
Contributor

Installed shakrespearelang and ran the example .spl and got the following error

Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\new\AppData\Local\Programs\Python\Python312\Scripts\shakespeare.exe\__main__.py", line 4, in <module> File "C:\Users\new\AppData\Local\Programs\Python\Python312\Lib\site-packages\shakespearelang\cli.py", line 7, in <module> from ._repl import start_console, debug_play File "C:\Users\new\AppData\Local\Programs\Python\Python312\Lib\site-packages\shakespearelang\_repl.py", line 6, in <module> import readline ModuleNotFoundError: No module named 'readline'

it seems that there is an import of an unused and missing module here

removing that import fixes it and the output is as expected

@zmbc
Copy link
Owner

zmbc commented Feb 16, 2024

Hi @stuart-thomas-zoopla! Thanks for using shakespearelang!

It's actually not an unused import -- simply importing readline changes the behavior of input(). However, I did not realize when I wrote this that readline is only available on Unix-like systems. It doesn't work on Windows.

I'd be happy to accept a PR that wraps the import in a try block!

@stuart-thomas-zoopla
Copy link
Contributor Author

Ah ok, that makes sense. PR Incoming.

@zmbc
Copy link
Owner

zmbc commented Mar 2, 2024

Immediate issue fixed by #21, though broader support for Windows is a bit unclear.

@zmbc zmbc closed this as completed Mar 2, 2024
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