JarodMica / ai-voice-cloning

GNU General Public License v3.0
655 stars 144 forks source link

setup_cuda.bat fails due to tkinter dependency #103

Closed doerrf closed 6 months ago

doerrf commented 6 months ago

These are the last few lines of the output from running setup_cuda.bat in Windows 10 powershell that explain the relevant error (my username is dashed out for security).

3 File(s) copied
.\modules\bitsandbytes-windows\bin\cuda_setup\main.py
1 File(s) copied
.\modules\bitsandbytes-windows\bin\nn\__init__.py
1 File(s) copied
[2024-05-11 15:53:21,539] [INFO] [real_accelerator.py:191:get_accelerator] Setting ds_accelerator to cuda (auto detect)
W0511 15:53:21.818000 42480 torch\distributed\elastic\multiprocessing\redirects.py:27] NOTE: Redirects are currently not supported in Windows or MacOs.
2024-05-11 15:53:23 | INFO | rvc.configs.config | Found GPU NVIDIA GeForce GTX 1060 6GB, force to fp32
Whisper detected
Traceback (most recent call last):
  File "C:\Users\-----\audiobook_maker\ai-voice-cloning\src\main.py", line 24, in <module>
    from webui import *
  File "C:\Users\-----\audiobook_maker\ai-voice-cloning\src\webui.py", line 22, in <module>
    from modules.tortoise_dataset_tools.dataset_whisper_tools.dataset_maker_large_files import *
  File "C:\Users\-----\audiobook_maker\ai-voice-cloning\modules\tortoise_dataset_tools\dataset_whisper_tools\dataset_maker_large_files.py", line 15, in <module>
    import tkinter as tk
ModuleNotFoundError: No module named 'tkinter'
Press any key to continue . . .

This error still occurs when I install tkinter manually with python -m install tkinter. I also checked the local virtual environment to see if the virtual python environment has tkinter, and it ALSO seems to have it. So I'm not sure what I'm missing.

PS C:\Users\-----\audiobook_maker\ai-voice-cloning> .\venv\Scripts\activate
(venv) PS C:\Users\-----\audiobook_maker\ai-voice-cloning> python
Python 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>

I'll try to look deeper into this sometime later and retrace the steps of the install script, and bump the thread if I come across anything.

doerrf commented 6 months ago

okay so I found two issues with my python setup that were causing the error:

  1. the commands py -3.11 and python3.11 are two different installations of python. for some reason py -3.11 is 3.11.4 while python3.11 is 3.11.9. I thought I was being helpful by creating a python alias to point to 3.11.9 when running the install script, but this is already handled when setup_cuda.bat sets up a virtual environment pointing python to 3.11.4
  2. therefore, the error's caused by the fact that 3.11.9 has tkinter installed while 3.11.4 didn't. since tkinter can only be installed using the official python installer. I resolved the issue by reinstalling the exact python version the script was using (3.11.4) and including tkinter in my python installation https://www.python.org/downloads/release/python-3114/.