-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
tcl is not included to cpython python 3.11 #226
Comments
This is sort of expected at the moment. You need to tell TCL where it can find the init.tcl file. I am actually surprised tkinter is still being used which is why I did not bother looking into improving that experience yet. |
For now run this before importing tkinter: import os
import sys
os.environ["TCL_LIBRARY"] = sys.base_prefix + "/lib/tcl8.6"
os.environ["TK_LIBRARY"] = sys.base_prefix + "/lib/tk8.6" The only way in which I can automate this is to set those environment variables. Need to decide if that's a good idea still. |
In theory rye could throw a import os, sys; os.environ.setdefault("TCL_LIBRARY", sys.base_prefix + "/lib/tcl8.6"); os.environ.setdefault("TK_LIBRARY", sys.base_prefix + "/lib/tk8.6") |
This solution works well. Thank you for your help In other way, |
@seonglae that's likely because whatever
There are various things that can be done, but it's unclear what is the least hacky way to accomplish that. |
Right. I used global python binary for above solution. Hopefully others will not have to use TK. Thank you for more details. |
This will work out of the box in 0.4.0. |
PyInstaller is currently failing to build projects in environments where the `tkinter.Tcl()` call raises `TclError`, which happens when TCL_LIBRARY and TK_LIBRARY env vars are not set, and is common in virtualenvs (ref: astral-sh/rye#226). Rather than propagating this exception which crashes the build, catch this exception instead and allow PyInstaller to continue the the same as it does when `tkinter` fails to import.
PyInstaller is currently failing to build projects in environments where the `tkinter.Tcl()` call raises `TclError`, which happens when TCL_LIBRARY and TK_LIBRARY env vars are not set, and is common in virtualenvs (ref: astral-sh/rye#226). Rather than propagating this exception which crashes the build, catch this exception instead and allow PyInstaller to continue the the same as it does when `tkinter` fails to import.
PyInstaller is currently failing to build projects in environments where the `tkinter.Tcl()` call raises `TclError`, which happens when TCL_LIBRARY and TK_LIBRARY env vars are not set, and is common in virtualenvs (ref: astral-sh/rye#226). Rather than propagating this exception which crashes the build, catch this exception instead and allow PyInstaller to continue the the same as it does when `tkinter` fails to import.
I'm trying to use |
@EthanRosenthal this code runs with and without shell. can you provide an example where it fails? |
Yeah, here's code that fails without the shell
With stacktrace:
If you spawn a shell before running test, then a plot figure will successfully be shown:
In case it's relevant, I'm on Ubuntu 22.04. My computer is setup to use |
It sounds to me like the Python running there might not actually be the rye python executable. The |
here's
I wonder if this is due to a weird interaction with |
Ah, wait, you're totally right. The above code was from when I ran
Back to my original goal which is to be able to use |
Steps to Reproduce
Expected Result
no error
Actual Result
Version Info
Stacktrace
No response
The text was updated successfully, but these errors were encountered: