How do I update Python to 3.12?

I tried a solution that makes a new blank repl and configures it with python311 in dependencies(replit.nix) using the channel "stable-22_11"(.replit).
I know Nix has Python 3.12 but I don’t know what channel supports it or how to specify it in the channel parameter.

Repl templates are a lot less package heavy now than they were before, the new python template doesn’t even have a replit.nix file by default IIRC.

Open your .replit file (hidden by default) and change channel (under [nix]) to "stable-23_05" or "unstable". 23.11 is not supported yet.
Then, open System Dependencies tool and add python312.

I know that python 3.11 is available with modules (the default way to have python in python repls) though.

They don’t? The GitHub repo I imported into replit has the nix files there and it installed tons of extra libraries. Plus the default Python template has nix files. Edit: I just made new Python repl and you are right, my bad.

Older GitHub Repos will likely do that a lot, I recommend making a new Repl and manually importing the GitHub Repo.

Just did that lol. By “manually importing” do you mean using the “import from GitHub” button or something else?

This error happened after I installed the python312 with System Dependencies in the imported GitHub repo and when I ran it, this happened:

I meant to do git clone repo-url-here in the new Repl (I think that’s the right command)

It worked but it copied it inside a folder and it thinks that the folder) doesn’t exist even though it’s right there in the folder.

Try moving files you need out of the folder, either through the UI, or by doing mv -r folder/file-or-folder .

Everything is working but no modules are recognized. How do I change .pythonlibs to work with Python 3.12? Also, .gitignore doesn’t ignore .pythonlibs with “.pythonlibs/” in the git ignore file.

Just delete .pythonlibs and then type poetry install or poetry update in the shell.
Also, make sure your pyproject.toml’s python version is correct.

What do I change this line to? python = ">=3.10.0,<3.11"

You can probably just remove the <3.11 so that it supports 3.12.

This error shows after I delete the .pythonlibs folder and use either poetry install or poetry update Even after changing the version rules in pyproject.toml

The error indicates that one of the libraries that is built into python itself (another I think is setuptools is trying to be modified by poetry, which of course isn’t possible.

However, I took a look at your repl (at and noticed another important problem.

Look at your pyproject.toml file. Notice how there are a bunch of packages (that you definitely aren’t using) and that many of them have similar names to your actual files?
Replit will auto-install packages that it thinks you are trying to use.

To fix this, first open your .replit file and add:

disableGuessImports = true

near the top.

Then, open your pyproject.toml file and remove the packages that you don’t use under [tool.poetry.dependencies]. Then, run poetry update in the Shell.

Now it’s doing this 5 times(?) each with different packages(exceptiongroup, iniconfig, packaging, pluggy, tomli):

(Also, why are files that I made myself showing in [tool.poetry.dependencies]?)

So, first of all, it seems to me that you are trying to use new python features (like exception groups), but note that your current python version is still 3.10 .

Important question, is python 3.11 good enough for you, because it is much easier and better supported on replit.

The reason why your files were showing in your dependencies was because when you say something like

import entities

in your code, replit sees this and thinks that there is some sort of entities package that it needs to install (but this is wrong).

First, when I type python --version it shows as python 3.12.0b2. Second, I want 3.12 because of the new f-string features. Also, I haven’t imported exception groups unless that means grouping exceptions in a tuple.

Okay, let’s see…
If you run python in the Shell, you will see that it is 3.12, but poetry needs to be updated to recognize this.
Unfortunately, poetry is also a builtin and immutable, so… really not sure. I think there are existing python 3.12 templates on replit, not sure.

I will check though, give me a moment.