aedocw / epub2tts

Turn an epub or text file into an audiobook
Apache License 2.0
445 stars 44 forks source link

Include good Windows install instructions #104

Closed aedocw closed 6 months ago

aedocw commented 7 months ago

Right now there are no instructions to run this under Windows, other than one line for how to run it under docker.

There should be a section specifically for doing a windows install, with as many helpful links as possible.

If anyone has gone through a windows install and would like to include their steps here, it would be much appreciated. I can validate them and update the README. I took a quick first pass last night and was surprised as the level of hassle, but maybe it's easier than I realize and I just did not follow a good path.

danielw97 commented 7 months ago

Hi there, Not sure how useful this is as I had a lot of this setup already, although the path I would follow is below: For ease of use I would suggest the windows package manager chocolatey, as it will ensure things are on path etc.

  1. install espeak-ng from https://github.com/espeak-ng/espeak-ng/releases/latest
  2. install ffmpeg with the command choco install ffmpeg, make sure you are in an elevated powershell session.
  3. install python 3.11 with the command choco install python311
  4. Install git with the command choco install git.
  5. Decide where you want your epub2tts project to live, documents is a common place.
  6. Once you've found a directory you're happy with, clone the project with git clone https://github.com/aedocw/epub2tts and cd epub2tts so you're now in your working directory.
  7. There are probably a few different ways you can go here, I personally opted for a venv to keep everything organized.
  8. create a venv with the command python -m venv .venv
  9. Activate the venv, on windows the command is slightly different as you issue .venv\scripts\activate
  10. install epub2tts along with the requirements with the command pip install .
  11. If all goes well, you should be able to call epub2tts from within your venv and update it going forward. Not sure how useful these quick notes are, as you may have a preferred way of doing things. For sake of time at this stage I've skipped over installing chocolatey etc, as their docs are easily accessible. This could also all be done manually of course, although for end users I don't know how comfortable I am instructing them to edit their path environment variables etc. Hth a bit, and let me know if there's any testing/refining of this that would be useful for you. I'm mostly on linux now, although my primary reason for running this on windows is due to the fact that's where my slightly better gpu is. Can spin up a vm and test a fresh install, let me know what your thoughts are though.
aedocw commented 7 months ago

These instructions worked for me yesterday, though when I had tried them a few days earlier I got an error when pip was installing TTS. Seems like it was just a transient problem with a dependency, because I had no issues later. That problem was what made me think this was a more complicated process than I had expected, but seems like it's pretty straightforward.

This is helpful and gives me enough to go from, hopefully I will get to writing them this week.

michwad commented 7 months ago

I'm just fumbling blindly trying to learn to use awesome code and projects like this.. So a step by step like this is really helpful! It worked for me. Tho I was stuck on using CPU. Tried lots of things, but in the end i saw that requirements.txt was torch without CUDA. I did: "pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121" within .venv. So now i am happily converting my first epub to an audiobook!

winfran commented 6 months ago

Troubleshooting Windows installation

Thank you @danielw97 and @michwad for the instructions, and of course @aedocw for the fantastic work that you've done!

I've managed to install it on Windows, but encountered some roadblocks along the way, so I thought I'd list a couple of the issues I encountered with solutions which might be helpful for others trying to install.

At step 10 in @danielw97 's instructions (when running "pip install ."), the following errors may appear:

1. Microsoft C++ Build Tools not installed

ERROR: Could not build wheels for TTS, which is required to install pyproject.toml-based projects

This error appears if you haven't installed Microsoft C++ Build Tools. If you haven't installed, you should download the installer from: https://visualstudio.microsoft.com/visual-cpp-build-tools/ run the vs_BuildTools.exe and select the "C++ Buld tools" checkbox leaving all options at their default value. Note: This will require about 7 GB of space on C drive.

2. Cannot install lxml automatically

× Encountered error while trying to install package. ╰─> lxml

Run pip install lxml to install the latest version manually then re-run pip install .

At step 11, (when calling epub2tts), the following errors may appear:

3. ffmpeg not found

Rerun the command choco install ffmpeg, making sure you are in an elevated powershell session, outside of the virtual environment.

4. NLTK: punkt not found

Resource punkt not found. Please use the NLTK Downloader to obtain the resource:

Run the following to install it:

python -c "import nltk"
python -m nltk.downloader punkt

5. Enabling CUDA

Torch not compiled with CUDA enabled

As per @michwad 's solution, within .venv, run:

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

Note: this will require about 2.5 GB of space.

After that, you may get yet another error, stating that the graphics card drivers are out of date. You should update them to proceed.

rejuce commented 6 months ago

souns very complicated. usually I am under Linux but my desktop has to be windows, as I want CUDA there is only teh way over cuda enabled WSL2

Once that is installed (there are many easy guides for that) your Linux install instructions work 1:1 inside the WSL with CUDA working right away.

Just note that Ubutnu 20.04 has dependency issues ond WSL2-ubuntunu22.04 everything worked right away as described

aedocw commented 6 months ago

Thank you @winfran for these detailed steps! I think I'll have time to update the docs tomorrow and include this stuff, it is super helpful - really appreciate it!

bretthysuik commented 6 months ago

One thing to note is that installing deepspeed on Windows doesn't work. Potential workaround with a precompiled .whl (I haven't tried it): https://github.com/microsoft/DeepSpeed/issues/2588#issuecomment-1502628005

aedocw commented 6 months ago

README now has improved windows installation instructions.