Deep-Live-Cam
Deep-Live-Cam copied to clipboard
Python may not be configured for Tk
Hi, I already downloaded models and stored them on the models folder. I've also activated a virtual environment with python 3.10 using virtualenv (exactly, using v3.10.14). So I also installed dependencies as mentioned.
When running python run.py I got the following error.
Traceback (most recent call last):
File "/Users/johernandez/workspace/Deep-Live-Cam/run.py", line 3, in <module>
from modules import core
File "/Users/johernandez/workspace/Deep-Live-Cam/modules/core.py", line 20, in <module>
import modules.ui as ui
File "/Users/johernandez/workspace/Deep-Live-Cam/modules/ui.py", line 3, in <module>
import customtkinter as ctk
File "/Users/johernandez/workspace/Deep-Live-Cam/venv/lib/python3.10/site-packages/customtkinter/__init__.py", line 5, in <module>
from tkinter import Variable, StringVar, IntVar, DoubleVar, BooleanVar
File "/opt/homebrew/Cellar/[email protected]/3.10.14_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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
This Error appears when tk (tkinter) isn't installed in your system (not python module)
brew install python-tk
what worked for me:
- installed tkinter as suggested above
brew install python-tk - Then removed the previous venv, created a new one
- in the new venv run pip with
--force-reinstall. Just runningpip install -r requirements.txtdidn't work (cache I assume)
Finally worked! I already had it installed, but a newer version.
If somebody else has the problem, use brew search python-tk to know which version it's intalled.
I removed the one I had and then installed version 3.10.
@citizen-seven The steps mentioned above worked for me too, thank you.