#πŸ”’ "Can't find a usable init.tcl in the following directories" error

30 messages Β· Page 1 of 1 (latest)

celest cove
#

Hey. So I just installed the latest version of Python (3.13) a few days ago, and I installed the latest version of PyCharm (2024.2.3). So I tried running a simple program with matlab and numpy a few days ago, but I kept getting an error and gave up on it. However, today, when I tried another very simple program with just turtle, it also didn't work and gave the same error as the previous program, and I decided to come here for help, so here is the code and error:

Code:

import turtle

window = turtle.Screen()
tortoise = turtle.Turtle()
tortoise.forward(300)

Error:

Traceback (most recent call last):
File "C:\Users<username>\PycharmProjects\ProgTestPractice\01.py", line 3, in <module>
window = turtle.Screen()
File "C:\Users<username>\AppData\Local\Programs\Python\Python313\Lib\turtle.py", line 3699, in Screen
Turtle._screen = _Screen()
~~~~~~~^^
File "C:\Users<username>\AppData\Local\Programs\Python\Python313\Lib\turtle.py", line 3710, in init
_Screen._root = self._root = Root()
~~~~~^^
File "C:\Users<username>AppData\Local\Programs\Python\Python313\Lib\turtle.py", line 429, in init
TK.Tk.init(self)
~~~~~~~~~~~~~~^^^^^^
File "C:\Users<username>\AppData\Local\Programs\Python\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:
......(directories)......

This probably means that Tcl wasn't installed properly.

meager cradleBOT
#

@celest cove

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

weak sorrel
#

How did you install Python 3.13

celest cove
#

I installed it from the official website, and went on with the usual set up

weak sorrel
#

ok, at a command line, what do you get when you type py -0p

celest cove
celest cove
weak sorrel
#

(I should also note many other libraries don't yet work with 3.13 as they have not been updated yet so switching to it may be premature)

celest cove
#

I didn't really switch to it. I installed it for the first time a few days ago.

celest cove
weak sorrel
#

that is, using it for anything important right now may be premature, as many libraries don't yet work with it

#

if Tkinter isn't working properly that tells me somehow the installation got messed up

#

tbh I would yank it, and install 3.12 - and when you do that, right-click on the installer and select "run as admin" to ensure that it can install everything it needs in the right places

celest cove
#

Hmm, that's weird. Well, what do you recommend I do? Should I delete the Python 3.13 I got rn and get 3.12?

celest cove
weak sorrel
celest cove
weak sorrel
#

and make sure you set Pycharm to use 3.12 when you run programs, as well

celest cove
celest cove
#

Ok, thanks a lot for your help. I appreciate it! I'll try everything and update you in a bit.

#

Btw, 3.12.7 from the website, right?

weak sorrel
#

yes

celest cove
#

It finally worked. Thank you so much. I appreciate it!

#

Although one tiny issue. Do you know how can I make the window tortoise program above not disappear after finishing instantly?

weak sorrel
#

you can put an input() at the end of the program to wait for some input from the console and thus hold the window open.

meager cradleBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.