abhirooptalasila / AutoSub

A CLI script to generate subtitle files (SRT/VTT/TXT) for any video using either DeepSpeech or Coqui
MIT License
586 stars 102 forks source link

Docker build broken #65

Closed Loqova closed 2 years ago

Loqova commented 2 years ago

docker build -t autosub . Cannot build and results in

Step 11/13 : RUN pip3 install --no-cache-dir -r requirements.txt
 ---> Running in bdf3fc44f538
Collecting cycler==0.10.0 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting numpy (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/45/b2/6c7545bb7a38754d63048c7696804a0d947328125d81bf12beaa692c3ae3/numpy-1.19.5-cp36-cp36m-manylinux1_x86_64.whl (13.4MB)
Collecting stt==1.0.0 (from -r requirements.txt (line 3))
  Could not find a version that satisfies the requirement stt==1.0.0 (from -r requirements.txt (line 3)) (from versions: 0.10.0a5, 0.10.0a6, 0.10.0a8, 0.10.0a9, 0.10.0a10)
No matching distribution found for stt==1.0.0 (from -r requirements.txt (line 3))
The command '/bin/sh -c pip3 install --no-cache-dir -r requirements.txt' returned a non-zero code: 1
Loqova commented 2 years ago

I changed the line stt==1.0.0 in the requirements.txt file to stt==0.10.0a10. Build works now. No idea if this breaks something else.

Loqova commented 2 years ago

Ok, I would love to use this but after wasting two hours in Python versioning and dependency hell I didn't get it to work at all.

ghost commented 2 years ago

I van make it work using python 3.6 and by downloading the release. Cloning the repo won't work. The developer made some mistakes in the code so it wasn't working anymore.

Em 19 de junho de 2022 20:51:59 UTC, Hallucinating Robot @.***> escreveu:

Ok, I would love to use this but after wasting two hours in Python versioning and dependency hell I didn't get it to work at all.

-- Reply to this email directly or view it on GitHub: https://github.com/abhirooptalasila/AutoSub/issues/65#issuecomment-1159808783 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

abhirooptalasila commented 2 years ago

setup.py clearly requires python 3.6 or less as DeepSpeech's last supported python version was 3.6. The same goes for the docker build too. @g3434343 what exactly are you referring to?

Loqova commented 2 years ago

@g3434343 seems right. Python isn't my language and that was just confirmed again last night. I spend all night trying to get it to work an didn't, even with python 3.6.0. Installing specific versions and dependencies in Python seems like hell to me.

I tried making an entirely new Docker image, based it on image ubuntu:16.04 (as python 3.6.0 is also ancient). Here are some notes on that progress, unfinished work.

apt update
apt install -y make build-essential libssl-dev zlib1g-dev \
  libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
  libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git ffmpeg

# source /root/.bashrc
# export PATH="$HOME/.pyenv/bin:$PATH"
curl https://pyenv.run | bash
exec $SHELL
pyenv update
pyenv install 3.6.0
pyenv global 3.6.0
python -m pip install --upgrade pip

export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

export PYTHONIOENCODING=utf8

git clone https://github.com/abhirooptalasila/AutoSub.git
cd AutoSub
python setup.py install
pip install .

wget https://coqui.gateway.scarf.sh/dutch/acabunoc/v0.0.1/nl-acabunoc-1-prune-kenlm.scorer
wget https://coqui.gateway.scarf.sh/dutch/acabunoc/v0.0.1/model.pbmm
docker build -t autosubtest .
docker run -it autosubtest /bin/bash

I ran into one problem after another:

I think I ended with:

Traceback (most recent call last):
  File "autosub/main.py", line 8, in <module>
    from . import logger
ImportError: cannot import name 'logger'

Still didn't get it to work. I gave up after 4 hours. Maybe I will take a look into it later again.

@abhirooptalasila great you can make things work but you're the developer. You know what is where and how it works. Simply following the provided documentation is frustrating if it doesn't work. Then soon you find yourself reverse engineering and rewriting everything. Docker is exactly for this purpose, to have fixed all proper versions and dependencies packed with each other in an image. The docker build command should work out of the box or a working docker image can be published to Docker Hub.

Loqova commented 2 years ago

I didnt't test the mentioned PR yet. However I also upgraded pip and that solved only one issue of many. I doubt that this PR will fix the whole Docker build.