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

Tkinter application doesn't run from source build on Windows #58955

Closed
vsajip opened this issue May 8, 2012 · 11 comments
Closed

Tkinter application doesn't run from source build on Windows #58955

vsajip opened this issue May 8, 2012 · 11 comments
Labels
OS-windows stdlib Python modules in the Lib dir topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@vsajip
Copy link
Member

vsajip commented May 8, 2012

BPO 14750
Nosy @vsajip, @pitrou
Files
  • copy_tcl.bat.txt: Batch file to copy Tcl/Tk DLLs to build directory
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2012-05-08.11:43:28.285>
    labels = ['expert-tkinter', 'type-bug', 'library', 'OS-windows']
    title = "Tkinter application doesn't run from source build on Windows"
    updated_at = <Date 2019-04-26.18:50:26.801>
    user = 'https://github.com/vsajip'

    bugs.python.org fields:

    activity = <Date 2019-04-26.18:50:26.801>
    actor = 'BreamoreBoy'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'Tkinter', 'Windows']
    creation = <Date 2012-05-08.11:43:28.285>
    creator = 'vinay.sajip'
    dependencies = []
    files = ['25500']
    hgrepos = []
    issue_num = 14750
    keywords = ['patch', 'needs review']
    message_count = 8.0
    messages = ['160198', '160201', '160207', '160218', '160219', '160223', '160231', '222665']
    nosy_count = 3.0
    nosy_names = ['vinay.sajip', 'pitrou', 'gpolo']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14750'
    versions = ['Python 3.3']

    @vsajip
    Copy link
    Member Author

    vsajip commented May 8, 2012

    I'm now getting failures to import tkinter on Windows:

    C:\Users\Vinay\Projects\scratch>..\cpython\PCbuild\python tkhello.py
    Traceback (most recent call last):
      File "tkhello.py", line 1, in <module>
        from tkinter import *
      File "<frozen importlib._bootstrap>", line 977, in _find_and_load
      File "<frozen importlib._bootstrap>", line 596, in load_module
      File "<frozen importlib._bootstrap>", line 262, in module_for_loader_wrapper
      File "<frozen importlib._bootstrap>", line 484, in _load_module
      File "C:\Users\Vinay\Projects\cpython\lib\tkinter\__init__.py", line 36, in <module>
        from tkinter import _fix
    ImportError: cannot import name _fix

    I'm not sure if this is an importlib issue or a tkinter one, but with a recent build (30 April) this worked OK. The tkhello.py script is just

    from tkinter import *
    root = Tk()
    w = Label(root, text="Hello, world!")
    w.pack()
    root.mainloop()

    @vsajip vsajip added stdlib Python modules in the Lib dir OS-windows type-bug An unexpected behavior, bug, or error labels May 8, 2012
    @pitrou
    Copy link
    Member

    pitrou commented May 8, 2012

    For the record, the script works fine under Linux.
    Vinay, can you bisect and find out which revision introduced the issue?

    @briancurtin
    Copy link
    Member

    Reproduced here as well.

    @vsajip
    Copy link
    Member Author

    vsajip commented May 8, 2012

    I went back a fair way, and the failure still keeps happening. So now I'm wondering - is a Tk app *supposed* to work from a source build?

    I've verified that the test script works OK when run from an installed Python.

    So, this issue may be invalid, if we don't care about running Tk apps from a source build (if so, sorry for the noise) - or if we do care, then it's not an importlib issue, but Tk-related (I'm not a Tk expert by any means, so I'm not sure what needs to be done to make a Tk app work from a source build).

    @pitrou
    Copy link
    Member

    pitrou commented May 8, 2012

    I went back a fair way, and the failure still keeps happening. So now
    I'm wondering - is a Tk app *supposed* to work from a source build?

    Does it work with 3.2?
    Did you try debugging at the prompt? e.g. looking what tkinter.__file__
    is, etc.

    @vsajip
    Copy link
    Member Author

    vsajip commented May 8, 2012

    Does it work with 3.2?

    I'm not able to build 3.2 - make_buildinfo fails, seemingly because it can't find some Subversion-related files. I'll keep looking into it.

    @vsajip
    Copy link
    Member Author

    vsajip commented May 8, 2012

    The test script works if tcl85.dll and tk85.dll are copied into the build directory. This can be done using a small batch file and the XML

    <Tool
    Name="VCPostBuildEventTool"
    CommandLine="copy_tcl $(tcltkDir)\bin"
    />

    added to each build configuration in PCbuild\_tkinter.vcproj (can be added through the UI, of course).

    @vsajip vsajip changed the title importlib fails with tkinter application on Windows Tkinter application doesn't run from source build on Windows May 8, 2012
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 10, 2014

    Presumably out of date as we're now on 3.5.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @iritkatriel iritkatriel added the pending The issue will be closed if no feedback is provided label Nov 14, 2023
    @iritkatriel
    Copy link
    Member

    This bug report is over a decade old. Is it still relevant?

    @zooba
    Copy link
    Member

    zooba commented Nov 14, 2023

    I sure hope it's no longer relevant! Pretty sure we definitely copy the mentioned DLLs around now.

    @zooba zooba closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2023
    @terryjreedy terryjreedy removed the pending The issue will be closed if no feedback is provided label Nov 14, 2023
    @terryjreedy
    Copy link
    Member

    I have run, tested, and patched IDLE in locally compiled main at least since summer 2012, probably a bit longer. I had to copy the dlls for awhile until Zach Ware fixed external.bat to make tkinter work properly without fuss.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows stdlib Python modules in the Lib dir topic-tkinter type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants