**Description:
I went to modify my replit project and was notified that the project was automatically migrating to Nix. After the migration my replit no longer runs and throws build errors. It was previously running with 0 issues.
**Expected behavior:
my previously working replit would still work after the forced, automatic migration to Nix.
**Actual behavior: replit project no longer works and returns the following error:
$ python3 Main.py
Traceback (most recent call last):
File "/home/runner/League-Level-2-Games/Main.py", line 5, in <module>
import tkinter as tk
File "/nix/store/cgxc3jz7idrb1wnb2lard9rvcx6aw2si-python3-3.9.6/lib/python3.9/tkinter/__init__.py", line 37, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
exit status 1
Hi @DanielCommins ,welcome to the forums! If you are trying to install this module, enter pip install _tkinter into thw the Shell. But before that, is the _ part of the liibrary name?
Thank you for the replies, but I get the following error when trying to install tkinter from the command line:
~/League-Level-2-Games$ pip install --force-reinstall tkinter
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
WARNING: You are using pip version 21.1.3; however, version 23.1.2 is available.
You should consider upgrading via the '/nix/store/cgxc3jz7idrb1wnb2lard9rvcx6aw2si-python3-3.9.6/bin/python3.9 -m pip install --upgrade pip' command.
I never had to do a tkinter install before and I’m wondering why I have to do it now.
Reading some python docs, it sounds like tkinter should be a default install, and if it’s missing, I’d recommend trying your code in a new Repl and seeing if that resolves your issue.
Try running curl https://pythonify.util.repl.co/recreate_python3_venv.sh | bash in the shell of the affected Repl. This will regenerate your Repl’s virtual environment.
Thank you for the suggestion. Inputting that line into the console I am getting this error:
~/League-Level-2-Games$ curl https://pythonify.util.repl.co/recreate_python3_venv.sh | bash % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1675 100 1675 0 0 6860 0 --:--:-- --:--:-- --:--:-- 6864
PYTHONBIN not set. Please make sure it's set in your replit.nix file and try again.
Here is the content my replit.nit file (I never modified this file):