irmen / Tale

Interactive fiction (text adventure) and Mud framework
http://tale.readthedocs.io/
GNU Lesser General Public License v3.0
145 stars 35 forks source link

No module named 'tkinter' #37

Closed hampuskraft closed 4 years ago

hampuskraft commented 4 years ago

Hi there,

I discovered that the GUI for Tale appears to be broken on my machine.

$ python -m tale.demo.story --gui

-------------------------------------------------------
 CRASH OCCURRED! TIMESTAMP: 2019-12-19 12:48:50.079522
-------------------------------------------------------
 EXCEPTION: ModuleNotFoundError
 MESSAGE: No module named 'tkinter'
 Extended stacktrace follows (most recent call last):
   ----

File "C:\Users\19haho\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 192, in _run_module_as_main
Source code:
    return _run_code(code, main_globals, None,

   ----

File "C:\Users\19haho\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 85, in _run_code
Source code:
    exec(code, run_globals)

Local values:
    cached = 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo\\__pycache__\\story.cpython-38.pyc'
    code = <code object <module> at 0x00EF8F28, file "C:\Users\19haho\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tale\demo\story.py", line 1>
    fname = 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo\\story.py'
    init_globals = None
    loader = <_frozen_importlib_external.SourceFileLoader object at 0x00AEF808>
    mod_name = '__main__'
    mod_spec = ModuleSpec(name='tale.demo.story', loader=<_frozen_importlib_external.SourceFileLoader object at 0x00AEF808>, origin='C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo\\story.py')
    pkg_name = 'tale.demo'
    run_globals = {'__name__': '__main__', '__doc__': "\nEmbedded Demo story, start it with python -m tale.demo.story\n\n'Tale' mud driver, mudlib and interactive fiction framework\nCopyright by Irmen de Jong (irmen@razorvine.net)\n", '__package__': 'tale.demo', '__lo   ...(truncated to 250)
    script_name = None
   ----

File "C:\Users\19haho\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tale\demo\story.py", line 69, in <module>
Source code:
    run_from_cmdline(cmdline_args)

Local values:
    Driver = <class 'tale.driver.Driver'>
    Optional = typing.Optional
    Player = <class 'tale.player.Player'>
    Story = <class '__main__.Story'>
    StoryBase = <class 'tale.story.StoryBase'>
    __doc__ = "\nEmbedded Demo story, start it with python -m tale.demo.story\n\n'Tale' mud driver, mudlib and interactive fiction framework\nCopyright by Irmen de Jong (irmen@razorvine.net)\n"
    __file__ = 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo\\story.py'
    __name__ = '__main__'
    cmdline_args = ['--game', 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo', '--gui']
    gamedir = WindowsPath('C:/Users/19haho/AppData/Local/Programs/Python/Python38-32/lib/site-packages/tale/demo')
    pathlib = <module 'pathlib' from 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\pathlib.py'>
    run_from_cmdline = <function run_from_cmdline at 0x00F13658>
    sys = <module 'sys' (built-in)>
    tale = <module 'tale' from 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\__init__.py'>
   ----

File "C:\Users\19haho\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tale\main.py", line 49, in run_from_cmdline
Source code:
    from .tio import tkinter_io

Local values:
    IFDriver = <class 'tale.driver_if.IFDriver'>
    args = Namespace(delay=40, game='C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo', gui=True, mode='if', restricted=False, web=False, wizard=False)
    cmdline = ['--game', 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\demo', '--gui']
    driver = <tale.driver_if.IFDriver object at 0x0343DD90>
    game_mode = <GameMode.IF: 'if'>
    parser = ArgumentParser(prog='story.py', usage=None, description="\n        Tale framework 4.6 game driver. Use this to launch a game and specify some settings.\n        Sometimes the game will provide its own startup script that invokes this automatically.\n   ...(truncated to 250)
    tb = 'Traceback (most recent call last):\n  File "C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\site-packages\\tale\\main.py", line 45, in run_from_cmdline\n    driver.start(args.game)\n  File "C:\\Users\\19haho\\AppData\\Local\\P   ...(truncated to 250)
   ----

File "C:\Users\19haho\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tale\tio\tkinter_io.py", line 12, in <module>
Source code:
    import tkinter

Local values:
    __doc__ = "\nGUI input/output using Tkinter.\n\n'Tale' mud driver, mudlib and interactive fiction framework\nCopyright by Irmen de Jong (irmen@razorvine.net)\n"
    collections = <module 'collections' from 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\collections\\__init__.py'>
    re = <module 're' from 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\re.py'>
    sys = <module 'sys' (built-in)>
    textwrap = <module 'textwrap' from 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\textwrap.py'>
    threading = <module 'threading' from 'C:\\Users\\19haho\\AppData\\Local\\Programs\\Python\\Python38-32\\lib\\threading.py'>

 EXCEPTION HERE: ModuleNotFoundError: No module named 'tkinter'
-------------------------------------------------------

I'm using Python 3.8 and pip 19.3.1 on Windows 10 1809 (Build 17763.864). I've tried installing tkinter, but it doesn't exist.

Thanks!

Kind regards, Hampus Kraft.

irmen commented 4 years ago

Your python installation is borked. This is not a problem in Tale. Tkinter, on windows, is part of the standard Python installation and is not installed separately. I suggest wiping and reinstalling Python again (make sure you get the official python installation from python.org) (also, make 100% sure the python.exe you're launching is, in fact, the correct python 3.8 executable. I advise you to use the py.exe launcher on windows instead, with the correct version selection argument, and avoid calling python.exe)