UltraSinger icon indicating copy to clipboard operation
UltraSinger copied to clipboard

Windows : installation ..problem ?

Open zigomario opened this issue 1 year ago • 13 comments

Hello,

i'm not sur to understand the process instal. ( windows) Python 3.10 : ok ffmpeg in PATH : ok

Like run_on_windows don"t work .. i play manualy the scrypt : [-](c:\UltraSinger>.venv/Scripts/activate.bat cd src

i start finally here : (venv) c:\UltraSinger\src>

and..i try something like that : py UltraSinger.py --crepe full --whisper large-v2 -i "input/song_to_parse.mp3" --language=en

Results : ModuleNotFoundError: No module named 'Levenshtein'

So.. i do "pip install Levenshtein".. Replay my command..and :

Traceback (most recent call last): File "c:\UltraSinger\src\UltraSinger.py", line 9, in from packaging import version ModuleNotFoundError: No module named 'packaging'

=> pip install packaging

And again again again... x module to install later..

and now new Error :

ImportError: cannot import name 'Hyphenator' from 'hyphen' (c:\UltraSinger\venv\lib\site-packages\hyphen_init.py)_

Finaly, i'm not sur that i need to install all this module... my process install is wrong ? ( maybe error on my python ? )

edit .. After 15 module to install.. some trap ( downgrade yumi.., double install of hyphen) .. it's work .. I'm always suprising about this process but thanks you anyway for the tools

Thanks to advance

zigomario avatar Oct 16 '24 18:10 zigomario

I had the same issue on a Fresh installed Windows 10 and running these commands in the CMD with Admin rights helped. ` pip install pytube pip install python-Levenshtein pip install packaging pip install ffmpeg-python pip install demucs pip install pydub pip install librosa pip install dataclasses_json pip install yt_dlp pip install pillow pip install musicbrainzngs pip install pretty_midi pip install unidecode pip install crepe pip install hyphen pip install Hyphenator pip install pyhyphen pip install whisperx pip install langcodes pip install music21 pip install tensorflow pip install tensorflow-cpu

`

Maybe the requirements.txt needs an update to add these?

mARTin-B78 avatar Oct 18 '24 23:10 mARTin-B78

The issue is in the requirement.txt and is releated to this issue: https://github.com/rakuri255/UltraSinger/issues/170

I bumped the corrupt matplotlib. Should work now. Can you guys confirm?

rakuri255 avatar Oct 18 '24 23:10 rakuri255

How can I confirm it as now everything is installed. How can I set it back to a previous stage? Delete the Python310\Lib\site-packages folder?

mARTin-B78 avatar Oct 19 '24 00:10 mARTin-B78

without changing anything I get this error now "WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages)"

think it is the torch Package

pip install torch --no-cache-dir

WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages) Requirement already satisfied: torch in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (2.5.0) Requirement already satisfied: networkx in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from torch) (3.3) Requirement already satisfied: typing-extensions>=4.8.0 in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from torch) (4.12.2) Requirement already satisfied: filelock in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from torch) (3.15.4) Requirement already satisfied: fsspec in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from torch) (2024.6.1) Requirement already satisfied: jinja2 in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from torch) (3.1.4) Requirement already satisfied: sympy==1.13.1 in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from torch) (1.13.1) Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from sympy==1.13.1->torch) (1.3.0) Requirement already satisfied: MarkupSafe>=2.0 in c:\users\martin\appdata\local\programs\python\python310\lib\site-packages (from jinja2->torch) (2.1.5) WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages) WARNING: Ignoring invalid distribution -ensorflow (c:\users\martin\appdata\local\programs\python\python310\lib\site-packages)

mARTin-B78 avatar Oct 19 '24 02:10 mARTin-B78

I create installation Batch Scripts that install everything needed to run UltraSinger.

  • winget
  • ffmpeg
  • python 3.10
  • git
  • ultrasinger
  • musescore

JUST REMOVE THE ".TXT" at the end of the Files, Apart from the file "additional-requirements.txt" that stays as it is. additional-requirements.txt

Open an CMD Console in windows with admin rights.

1st-part-install-winget-ffmpeg-and-python-3.10.bat 1st-part-install-winget-ffmpeg-and-python-3.10.bat.TXT REBOOT - cause of Python

Open an CMD Console in windows with admin rights.

2nd-part-install-git-ultrasinger-with-modules-musescore.bat 2nd-part-install-git-ultrasinger-with-modules-musescore.bat.TXT

When Everything is installed you can use a Batchfile to Generate Karaoke Songs out of Youtube Playlists with UltraSinger batch_generate_karaoke_songs_from_youtube_playlist_with_ultrasinger.bat.txt

mARTin-B78 avatar Oct 19 '24 03:10 mARTin-B78

For reinstallation you should delete the venv folder. For go to previous version you can checkout previous commit with git.

rakuri255 avatar Oct 19 '24 08:10 rakuri255

@mARTin-B78 make an PR and we could add it to the project :)

rakuri255 avatar Oct 19 '24 08:10 rakuri255

I recreated the Installer for Windows made for people who are not programmers and have most tools not installed yet.

Batch Script 1 1st-part-install-winget-ffmpeg-and-python-3.10.bat download and remove the ".TXT" 1st-part-install-winget-ffmpeg-and-python-3.10.bat.TXT

  1. Check and Install Winget Verifies if Winget is installed; if not, it installs Winget automatically.
  2. Check and Install FFMPEG Tests if FFMPEG is installed; if missing, installs FFMPEG and sets the environment variable.
  3. Check and Install Python 3.10 Ensures Python 3.10 is installed; if not, installs it and sets the environment variable.

Finally, it informs the user to reboot the system.

Batch Script 2 2nd-part-install-git-ultrasinger-with-modules-musescore.bat 2nd-part-install-git-ultrasinger-with-modules-musescore.bat.TXT download and remove the ".TXT"

  1. Re-check and Install Winget Confirms that Winget is truly installed; if not, installs it, or skips this step if already present.
  2. Check and Install PIP Verifies if PIP is installed and installs it if necessary.
  3. Check and Install GIT Ensures GIT is installed; if not, it installs GIT.
  4. Check and Install UltraSinger Checks if UltraSinger is installed and installs it if needed.
  5. Check and Optional Install of MuseScore Verifies if MuseScore is installed; if not, it asks the user whether to install MuseScore.
  6. Install Python Packages from requirements.txt Installs all required packages listed in requirements.txt.
  7. Check and Install CUDA Checks if a GPU is available. If yes, installs CUDA; otherwise, sets up CPU support.
  8. Additional Python Packages Installs missing Python packages from additional-requirements.txt.

at the end it uninstalls torch and reinstalls torch - I do not know why it does not work without that step.

File with python modules that seme to be missing additional-requirements.txt

Batch workflow batch_generate_karaoke_songs_from_youtube_playlist_with_ultrasinger.bat.TXT

mARTin-B78 avatar Oct 31 '24 17:10 mARTin-B78

@mARTin-B78 thanks a lot for your scripts. I had some errors with 2nd script:

1st error: [EDIT] solved by using python and py launcher Ver 3.10.11 and deleting all other instances...

Collecting resampy==0.2.2 (from -r C:\Program Files\UltraSinger\requirements.txt (line 458))
  Downloading resampy-0.2.2.tar.gz (323 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\userxy\AppData\Local\Temp\pip-install-zg63pcez\resampy_a940f56546eb404ca8ae07ad60e34e7b\setup.py", line 2, in <module>
          import imp
      ModuleNotFoundError: No module named 'imp'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Checking for GPU...
GPU found: Citrix Indirect Display Adapter`

2nd error: [EDIT] maybe not relevant???

Installing CPU-only packages...
No suitable Python runtime found
Pass --list (-0) to see all detected environments on your machine
or set environment variable PYLAUNCHER_ALLOW_INSTALL to use winget
or open the Microsoft Store to the requested version.
Das System kann den angegebenen Pfad nicht finden.

3rd error: [EDIT] maybe not relevant???

ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
ERROR: Could not find a version that satisfies the requirement torch==2.0.1 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 2.5.0, 2.5.1)
ERROR: No matching distribution found for torch==2.0.1
UNINSTALLING AND REINSTALLING torch, cause otherwise it does not work
ECHO ist ausgeschaltet (OFF).
Found existing installation: torch 2.5.1
Uninstalling torch-2.5.1:
  Would remove:``

I think there is a double installation of requirements.txt:

1st occurrence:

:: Install the required Python packages echo Installing required Python packages... echo %ultrasinger_dir% py -m pip install -r "%ultrasinger_dir%\requirements.txt"

2nd occourence:

CPU/GPU:

echo Installing CPU-only packages...
@echo off
cd ..
cd ..
py -3.10 -m venv .venv2
call .venv\Scripts\activate
pip install -r requirements.txt

I would guess only executing once is sufficient.

[EDIT] It seems with just sorting the mess of several Python versions installed, the first Error disapperared and the others seems not relevant. Unfortunaltey I had to reinstall requirements.txt manually again after 2nd script. Maybe that error would not have occoured if the second installation of requirements.txt would have been performed. Everything else seems to work... Thanks a lot.

passuff avatar Dec 09 '24 13:12 passuff

These scripts do not create a venv, if I am not mistaken. Generally speaking, not a good idea :) Great work though

agwosdz avatar Dec 24 '24 11:12 agwosdz

UltraSinger itself now checks for ffmpeg. Python 3.10 is only needed because of tensorflow 2.10 which also only needed to use gpu on Windows. For docker and colab, which is linux, we use the latest versions.

Tensorflow is used by crepe. Maybe we should switch to torchcrepe to also use torch.

rakuri255 avatar Dec 30 '24 11:12 rakuri255

Same problem here. Tried @mARTin-B78 's batch files but it hangs on script 1 - keeps saying "Updating winget package sources" for hours.

EDIT: after deleting that part of the batch file, it seems to run as it should as does script 2, but afterwards starting Ultrasinger.py again gives the same error, that it's missing Levenshtein (and all other stuff afterwards). Starting both batch files again doesn't make any difference.

Bokkiej avatar Jan 04 '25 11:01 Bokkiej

Same problem here. Tried @mARTin-B78 's batch files but it hangs on script 1 - keeps saying "Updating winget package sources" for hours.

EDIT: after deleting that part of the batch file, it seems to run as it should as does script 2, but afterwards starting Ultrasinger.py again gives the same error, that it's missing Levenshtein (and all other stuff afterwards). Starting both batch files again doesn't make any difference.

If its missing Levenshtein, that seems to be fixed by installing C++ dev kit as mentioned here: https://github.com/rakuri255/UltraSinger/issues/170#issuecomment-2338646815

Tried installing UltraSinger today (2025/4/24) and had exact same issues mentioned in this thread, but even after all the workarounds, I still ended up back at the same error as OP, very frustrating:

ImportError: cannot import name 'Hyphenator' from 'hyphen'

I'm using Python 3.10.6 and tried the latest UltraSinger as well as the Dec 2024 release.

vin901 avatar Apr 25 '25 00:04 vin901

I updated the requirements.txt Problem was that whisperX couldnt be installed.

Please open this issue again if you have still problems!

rakuri255 avatar May 02 '25 20:05 rakuri255