You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tkinter requires some subfolders from the tcl folder of the CPython installation. However poetry does not copy these in, and poetry does not allow post-install scripts, meaning there is no simple way to automate this at installation.
Workarounds
Manually copy tcl8.6 and tk8.6 into the venv's Lib folder.
### Example pyproject.toml
```TOML
Any vanilla script that uses `tkinter`:
poetry run vpcp.py
Traceback (most recent call last):
File "C:\Projects\vpcp\vpcp.py", line 2758, in <module>
main()
~~~~^^
File "C:\Projects\vpcp\vpcp.py", line 2737, in main
root = tk.Tk()
File "C:\Program Files\Python313\Lib\tkinter\__init__.py", line 2459, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:/Program Files/Python313/lib/tcl8.6} C:/Users/me/AppData/Local/pypoetry/Cache/virtualenvs/vpcp-hmXVBWTb-py3.13/lib/tcl8.6 C:/Users/me/AppData/Local/pypoetry/Cache/virtualenvs/lib/tcl8.6 C:/Users/me/AppData/Local/pypoetry/Cache/virtualenvs/vpcp-hmXVBWTb-py3.13/library C:/Users/me/AppData/Local/pypoetry/Cache/virtualenvs/library C:/Users/me/AppData/Local/pypoetry/Cache/virtualenvs/tcl8.6.14/library C:/Users/me/AppData/Local/pypoetry/Cache/tcl8.6.14/library
This probably means that Tcl wasn't installed properly.
### Poetry Runtime Logs
```bash session
N/A
The text was updated successfully, but these errors were encountered:
Description
tkinter
requires some subfolders from thetcl
folder of the CPython installation. Howeverpoetry
does not copy these in, andpoetry
does not allow post-install scripts, meaning there is no simple way to automate this at installation.Workarounds
Manually copy
tcl8.6
andtk8.6
into the venv'sLib
folder.Poetry Installation Method
pipx
Operating System
Windows 11
Poetry Version
1.8.4
Poetry Configuration
The text was updated successfully, but these errors were encountered: