jianchang512 / pyvideotrans

Translate the video from one language to another and add dubbing. 将视频从一种语言翻译为另一种语言,同时支持语音识别转录、语音合成、字幕翻译。
https://pyvideotrans.com
GNU General Public License v3.0
10.92k stars 1.22k forks source link

PyVideoTrans Installed on Ubuntu 22.04.4 LTS QEMU/KVM Guest #526

Closed mbennette68 closed 2 months ago

mbennette68 commented 3 months ago

Hi,

QUESTION:

I'm trying to see if it is possible to install python sp.py in a QEMU/KVM Ubuntu 22.04.4 LTS guest running inside my Pop!_OS 22.04 host machine. My machine has an NVidia Card but it is not really detected by the QEMU/KVM guest OS. The guest is using the Virtio video device.

I've tried to install on various guests, including the latest Debian and Fedora OS, as well as Ubuntu 18.04, 20.04 but it generated many errors and the installation of PyVideoTrans was not successful. I know there is a way to pass through the video card to the QEMU guest OS but I don't want to do that at the moment since the kernel has to be modified and I don't wish to risk destroying my host OS install. If I can make it work within a virtual machine, then I might risk installing PyVideoTrans into a regular machine.

Is it possible to install PyVideoTrans on a virtual machine?

SUGGESTION:

The install instructions are not necessarily the best, as I've run into issues, particularly when I reach the step asking to run: python sp.py which generates certain errors. My main error was failing to notice the needed dependencies which are listed at the end of the page, in the Acknowledgements section. That information might be better placed at the top of the page, in my view as well as which OS version numbers are better supported by PyVideoTrans.

I think it'd be a better option to use a linux bash script file that would test the system, inform of missing dependencies and then proceed to create the virtual environment, install the software, and download the dependencies as needed. This will reduce errors and frustrations.

Any suggestions or instructions on KVM install would be appreciated.

Thank you, MB

boystray commented 3 months ago

no need GPU,just using cpu to run PyVideoTrans. change torch with cuda to torch with cpu

mbennette68 commented 3 months ago

I will see if I can make it work.

Thank you. :)

mbennette68 commented 3 months ago

I tried to install PyVideoTrans in Ubuntu 22.04.x LTS but has errors.

I recorded a video screen-cast of my issue if you want to take a look at it. The site will delete the video in two days.

What am I doing wrong?

Thank you, MB

jianchang512 commented 3 months ago
  1. remove pip 23.2.1 from /usr/local/lib/python3.10/site-packages/pip (python 3.10) this is comment
  2. sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1

add 1 at end

mbennette68 commented 3 months ago

Hello,

Did not work.

sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1 does not add pyththon3.10 to /usr/local/bin.

Perhaps not enough permissions?

Here is an image of what I got: ub2204-lts_pytransvid_error_2024-08-30_15:30:00

Thank you, MB

jianchang512 commented 3 months ago

Execute python -V, if the version number is already 3.10, you don't need to execute the previous command.

else

which python3.10

Execute the command, see where the returned 3.10 is, and then replace the

mbennette68 commented 2 months ago

Hi,

I was able to setup Python 3.10.x. With that being said, there were other errors that prevented the creation of the, "sp.py" file.

The errors started with STEP 6:

I did install python3-wheel but still it generated errors. I've attached the output of the errors from the terminal for your convenience. It doesn't look like I can install PyVideoTrans on this Ubuntu 22.04 VM.

ub-22 04 4-LTS_pytransvid_mirror_error_2024-09-02_16:20:49_3

pyvideotrans_errors_2.txt

Perhaps I'll have better luck with Ubuntu 24.04 LTS?

Thank you, MB

jianchang512 commented 2 months ago

pip uninstall -y cmake

pip install --upgrade wheel pip

mbennette68 commented 2 months ago

Hi,

I tried ...

I still get errors.

I've attached an image and file with the terminal output and errors: pyvideotrans_errors_3.txt

pyvidtras_conda_2024-09-03 11-54-06

I can't find the cause of the Subprocess Error :(

Thank you, MB

jianchang512 commented 2 months ago

Open requirements.txt and delete the samplerate== line. Then reinstall it and pip install samplerate separately after successful installation.

mbennette68 commented 2 months ago

Hi,

Installing samplerate seperately in Ubuntu 22.04 LTS did not solve the issue.

Here's the terminal output file: pyvideotrans_errors_4.txt

It includes the miniconda3 environment information + packages installed.

I also tried in Ubuntu 24.04.1 LTS Desktop and it fails in the same way. Here's a short 7 minute video of the errors with 24.04.1 LTS The video will be taken down in 2 days.

The network bandwidth when using pip install -r requirements.txt ... is better during the mornings in my timezone.

Thanks, :)

jianchang512 commented 2 months ago

Try installing in python3 natively, not in conda, it looks like it might be a compiler mismatch!

mbennette68 commented 2 months ago

Hi,

That possibility has been stuck in my mind, so I decided to switch to another Linux OS to test that possibility.

I decided to use Rocky Linux 9.4 (rhel clone) to see if I would get the same errors and I did. I made a 27 minute video which you can check out here. There are some errors in the install instructions which I found when I tried the install.

It does not look like a compiler mismatch since it has happened on 7 Linux distros, e.g. Ubuntu 18.04/20.04/22.04/24.04 and Fedora 40/Rocky 9.4 and Debian 12.7 though on Debian some of the tools could not be installed as the system could not find them for installation.

I don't know if PyVideoTrans can be installed on my virtual machine. Most of the distros suffer from the same, samplerate, error :(

I'm exhausted :)

Thanks, MB

jianchang512 commented 2 months ago

First, install pip install samplerate separately, if no errors are reported, the installation was successful, then run requirements.txt

mbennette68 commented 2 months ago

Hi,

I just did it in Rocky Linux 9.4 and the same error is generated. I tried it with cmake installed outside the venv and also installed inside venv.

image

Python's install path was determined by the instruction on PyVideoTrans site.

Here's a pyvideotrans_errors_5.txt containing the terminal commands and errors.

samplerate is not allowing the install to proceed.

I'll try again tomorrow.

Thanks, MB :)

mbennette68 commented 2 months ago

Hi,

I gave it a final try using Ubuntu 22.04 LTS steps, and changed a few things but it still failed, and corrupted my Virtual Machine installs everytime. Main problem for ubuntu steps is "/usr/local/bin/python3.1x" and "/usr/bin/python3.1x locations". Given these errors, I don't wish to install it on an baremetal hardware until all issues are fixed.

Here's the _pyvideotrans_errors_7_09-09-24.txt_ with the results.

Here's a longer video of the errors I got.

I can't resolve the issue.

Thank you for your help, :)