DrewThomasson / VoxNovel

VoxNovel: generate audiobooks giving each character a different voice actor.
MIT License
131 stars 17 forks source link

WSL dependency setup error #39

Closed AntitrustEnthusiast closed 3 days ago

AntitrustEnthusiast commented 3 days ago

When running this step in the Windows 11 setup: yes | wget -O - https://raw.githubusercontent.com/DrewThomasson/VoxNovel/main/shell_install_scripts/Ubuntu-install.sh | bash

I get this error:

ERROR: Cannot install -r Ubuntu_requirements.txt (line 105), -r Ubuntu_requirements.txt (line 15), -r Ubuntu_requirements.txt (line 2), -r Ubuntu_requirements.txt (line 24), -r Ubuntu_requirements.txt (line 29), -r Ubuntu_requirements.txt (line 42), -r Ubuntu_requirements.txt (line 58), -r Ubuntu_requirements.txt (line 71), -r Ubuntu_requirements.txt (line 89), -r Ubuntu_requirements.txt (line 95), -r Ubuntu_requirements.txt (line 96) and numpy==1.26.4 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested numpy==1.26.4
    accelerate 0.24.1 depends on numpy>=1.17
    blis 0.7.11 depends on numpy>=1.19.0; python_version >= "3.9"
    clean-fid 0.1.35 depends on numpy>=1.14.3
    contourpy 1.2.0 depends on numpy<2.0 and >=1.20
    encodec 0.1.1 depends on numpy
    gruut 2.2.3 depends on numpy<2.0.0 and >=1.19.0
    imageio 2.32.0 depends on numpy
    librosa 0.10.0 depends on numpy>=1.20.3
    matplotlib 3.7.3 depends on numpy<2 and >=1.20
    moviepy 1.0.3 depends on numpy>=1.17.3; python_version != "2.7"
    moviepy 1.0.3 depends on numpy; python_version >= "2.7"
    numba 0.57.0 depends on numpy<1.25 and >=1.21

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Took a bit to find this error, because the Windows 11 setup script doesn't pause/exit on error, it just keeps going assuming everything worked properly.

Seems Ubuntu_requirements.txt is over-constrained, with every dependency asking for an exact version.

DrewThomasson commented 3 days ago

Interesting... and that makes the app not work? I'll look into this...

DrewThomasson commented 3 days ago

Just asking for clarification, Does this make VoxNovel unable to run?

and which installation method were you using?

AntitrustEnthusiast commented 3 days ago

I was going through the Windows 11 setup, including a new WSL install and conda environment.

It caused a module not found error when I tried running python headless_voxnovel.py

DrewThomasson commented 3 days ago

hmm... I'll look into this by re-installing on my Windows computer

In the meantime idk you could try one of the headless docker images?

you'll probs have to increase the max ram usage allowed for docker in windows if it crashes in the process

16 gb of ram is most likely needed

https://www.youtube.com/watch?v=dxEbtZsBO2A

🐳 Docker (Sound not working in gui yet)
🐳 Headless Docker
Docker headless m1 🍏Mac 1. `cd ~` 2. `git clone https://github.com/DrewThomasson/VoxNovel.git` 3. `sudo docker run -v "$HOME/VoxNovel:/VoxNovel/" -it athomasson2/voxnovel:headless_m1_v2`
Headless Docker 🐧 Linux/Intel 🍏Mac ## For Headless Docker on only cpu 1. `cd ~` 2. `git clone https://github.com/DrewThomasson/VoxNovel.git` 3. `sudo docker run -v "$HOME/VoxNovel:/VoxNovel/" -it athomasson2/voxnovel:latest_headless` ## For headless docker with gpu speedup if you have a nvida gpu 1. `cd ~` 2. `git clone https://github.com/DrewThomasson/VoxNovel.git` 3. `sudo docker run --gpus all -v "$HOME/VoxNovel:/VoxNovel/" -it athomasson2/voxnovel:latest_headless`
Headless Docker 🖥️ Windows ### Installation and Setup on Windows (PowerShell) Follow these steps to set up the VoxNovel project on a Windows system using PowerShell: 1. Navigate to your user profile directory: ```powershell cd $env:USERPROFILE ``` 2. Clone the VoxNovel repository from GitHub: ```powershell git clone https://github.com/DrewThomasson/VoxNovel.git ``` ### Running VoxNovel in Docker #### For Headless Operation on CPU To run the VoxNovel application in a Docker container on your CPU: ```powershell docker run -v "${env:USERPROFILE}/VoxNovel/:/VoxNovel/" -it athomasson2/voxnovel:latest_headless ``` #### For Headless Operation with NVIDIA GPU Speedup If you have an NVIDIA GPU and want to accelerate processing, use the following command: ```powershell docker run --gpus all -v "${env:USERPROFILE}/VoxNovel/:/VoxNovel/" -it athomasson2/voxnovel:latest_headless ```
🐳 GUI Docker (Sound not working in gui yet)
🐧 Linux Docker 1. `cd ~` 2. `git clone https://github.com/DrewThomasson/VoxNovel.git` 3. `sudo docker run --gpus all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --device /dev/snd -v "$HOME/VoxNovel:/VoxNovel/" -it athomasson2/voxnovel:latest`
🍏 Mac Docker ## Setting Up GUI Applications with Docker on macOS This guide provides instructions on how to run a Docker container with a graphical user interface on macOS using XQuartz for X11 forwarding and volume mounting. ### Install XQuartz 1. Download and install XQuartz from [XQuartz website](https://www.xquartz.org/). 2. Open XQuartz. 3. Go to `XQuartz` -> `Preferences`. 4. In the `Security` tab, enable **Allow connections from network clients**. 5. Restart XQuartz to apply these settings. ### Configure and Run the Docker Container #### Allow Docker to Connect to XQuartz Open a terminal and run the following command to allow connections from your local machine to XQuartz: xhost + $(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}') #### Start the Docker Container Run the following command to start your Docker container. This command configures the GUI to display on your host and mounts the necessary directories: ``` cd ~ git clone https://github.com/DrewThomasson/VoxNovel.git docker run -e DISPLAY=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}'):0 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v "/Users/$(whoami)/VoxNovel:/VoxNovel" \ athomasson2/voxnovel:latest ``` ### Notes - **XQuartz Configuration**: Ensure that XQuartz is configured to allow network clients before attempting to connect. - **Directory Existence**: Verify that the directory `/Users/$(whoami)/VoxNovel` exists on your Mac. If not, create it or adjust the volume mount path in the Docker command as needed. - **Firewall and Security**: If you face connectivity issues, check any firewall settings and security preferences that might block the connections.
🪟 Windows Docker 1. Install VcXsrv: ```sh choco install vcxsrv ``` - First install VcXsrv and configure it to allow connections.
How to setup VcXsrv After installing VcXsrv, it typically launches automatically. You can confirm it's running by checking for its icon in the system tray, usually located near the clock in the taskbar. It may also start automatically when you log in to your system. To ensure it's configured to allow connections from Docker containers, follow these steps: 1. Right-click on the VcXsrv icon in the system tray. 2. Select "XLaunch" to open the configuration wizard. 3. In the configuration wizard, select "Multiple windows" and proceed to the next step. 4. Choose your preferred settings for display number and screen. 5. In the "Extra settings" window, make sure to check the box labeled "Disable access control" to allow connections from Docker containers. 6. Complete the configuration by clicking "Finish" and then "Save configuration" when prompted. With these settings, VcXsrv should be running and configured to allow connections from Docker containers. You can now proceed with running your Docker commands requiring GUI support.
2. Change to your home directory: ```sh cd $HOME ``` 3. Clone the repository: ```sh git clone https://github.com/DrewThomasson/VoxNovel.git ``` 4. Run the Docker container: ```sh docker run -e DISPLAY=host.docker.internal:0 -v "/Users/$(whoami)/VoxNovel:/VoxNovel/" -it athomasson2/voxnovel:latest ```
AntitrustEnthusiast commented 3 days ago

Thanks, headless Docker setup worked for me

DrewThomasson commented 3 days ago

Fantastic! 🎉

DrewThomasson commented 3 days ago

And if you really want the interface I have a .tar backup of a working WSL2 ENV as a tar,

guide for importing and using .tar wsl VoxNovel working Backup Here’s the guide without the automated download, where you download the WSL .tar file manually first. Full Guide: Importing and Running the VoxNovel WSL Environment This guide will walk you through downloading the VoxNovel WSL environment .tar file manually, importing it into WSL, running the environment, and finally cleaning it up when no longer needed. Step 1: Download the VoxNovel WSL .tar File 1. Manually download the WSL .tar file from the following link: https://huggingface.co/drewThomasson/VoxNovel_WSL_ENV/resolve/main/Windows_WSL_VoxNovel.tar?download=true Download VoxNovel WSL Environment Save this file to an accessible location on your computer, such as C:\Users\\Downloads. Step 2: Import the VoxNovel WSL Environment 1. Open PowerShell or Command Prompt as Administrator. 2. Run the following command to import the downloaded .tar file into WSL under the name VoxNovel: wsl --import VoxNovel C:\WSL\VoxNovel C:\Users\\Downloads\Windows_WSL_VoxNovel.tar • Replace with your actual Windows username. • This will import the WSL environment into the C:\WSL\VoxNovel folder and register it under the name VoxNovel. Step 3: Access the VoxNovel WSL Environment Once the import is complete, access the VoxNovel environment by running: wsl -d VoxNovel This command will open a shell inside the VoxNovel WSL environment. Step 4: Set Up and Run the VoxNovel Application 1. Make the Script Executable Inside the WSL environment, run the following command to make the provided shell script executable: chmod +x ~/VoxNovel/shell_install_scripts/Windows-install-scripts/wsl_import_run.sh 2. Run the Shell Script To set up and launch the VoxNovel application, run the following command: ~/VoxNovel/shell_install_scripts/Windows-install-scripts/wsl_import_run.sh Step 5: Shell Script Overview Here’s a breakdown of what the wsl_import_run.sh script does: #!/bin/bash # Switch to the appropriate user su - drew export DISPLAY=:0 # Sound may not work in an imported WSL environment echo "Conda path: $(which conda)" echo "Available environments:" conda env list # Activate the VoxNovel environment echo "Activating environment..." source ~/miniconda/etc/profile.d/conda.sh conda activate VoxNovel # Confirm the active environment and run the VoxNovel application echo "Current environment: $CONDA_DEFAULT_ENV" cd ~/VoxNovel echo "Running Python script..." python gui_run.py What the Script Does: • Switch User: Switches to the drew user. • Set Display: Exports the DISPLAY variable to enable GUI functionality. • Conda Setup: Displays available Conda environments and activates the VoxNovel environment. • Run VoxNovel: After activating the environment, it runs the Python script gui_run.py to launch the VoxNovel application. Note: Due to WSL limitations, sound may not work in this environment without additional setup. Step 6: Delete the WSL .tar File to Free Up Space After successfully importing the .tar file into WSL, you no longer need the .tar file. To free up space, you can manually delete it: 1. Navigate to where you saved the .tar file (e.g., C:\Users\\Downloads). 2. Delete the Windows_WSL_VoxNovel.tar file to free up space. Step 7: How to Clean Up the VoxNovel WSL Environment If you no longer need the VoxNovel WSL environment, you can delete it completely: 1. Open PowerShell as Administrator. 2. Run the following command to unregister (delete) the VoxNovel WSL environment: wsl --unregister VoxNovel This will remove all data associated with the VoxNovel environment, freeing up space. Final Notes After following this guide, you’ll have downloaded and imported the VoxNovel WSL environment, run the application, and learned how to clean up the environment and unnecessary files.

(I love docker lol)