erew123 / alltalk_tts

AllTalk is based on the Coqui TTS engine, similar to the Coqui_tts extension for Text generation webUI, however supports a variety of advanced features, such as a settings page, low VRAM support, DeepSpeed, narrator, model finetuning, custom models, wav file maintenance. It can also be used with 3rd Party software via JSON calls.
GNU Affero General Public License v3.0
816 stars 91 forks source link

Issue: 'pip' Not Recognized When Installing AllTalk in Text-Generation-WebUI Environment #164

Closed Quidam2k closed 4 months ago

Quidam2k commented 4 months ago

The issue described also kept me from being able to generate a diagnostic report. I did some troubleshooting with GPT4 before posting, then had it generate a summary of the issue and what was tried. Folder does not have spaces in it.

Environment:

Windows 10
Python 3.11.4
pip 23.1.2
Activated environment through cmd_windows.bat from a Text-Generation-WebUI setup

Problem: Attempting to install AllTalk within the Text-Generation-WebUI results in an error when running the AllTalk setup script. Despite activating the environment and confirming that pip is accessible and correctly prioritized, the script fails with 'pip' is not recognized as an internal or external command, operable program or batch file.

Troubleshooting Steps Taken:

Confirmed Python and pip installations, and their correct operation outside of the environment.
Verified that the cmd_windows.bat script correctly activates the environment, with pip accessible and PATH including the environment's Scripts directory.
Used WHERE PIP to confirm the command prompt prioritizes the environment's pip correctly.
Attempted direct execution of pip commands within the activated environment, which worked as expected, suggesting the issue is isolated to the script execution.
Considered modifying the AllTalk setup script to directly use the full path to pip to bypass any environmental path issues.
Suggested a manual installation of requirements as a workaround to script execution issues.

Additional Notes: The environment and global installations of Python and pip are correctly set up, with the issue seemingly isolated to the execution context of the AllTalk setup script within the Text-Generation-WebUI environment. The exact cause of the 'pip' not recognized error within this specific setup process remains unclear.

erew123 commented 4 months ago

Hi @Quidam2k

PIP is a core part of Python, so if it cant find PIP then you cannot be in a Python environment.

Could you confirm that the Python environment starts up correctly? Please see the diagram from the help section in Understanding Python Environments Simplified. Does your command line change in that way shown in the diagram?

If so, can you start the python environment and try typing pip and press enter. This should give you back a whole window full of text e.g.

image

If this doesn't, it suggests to me that your Text-gen-webui environment is damaged somehow.

Ive double checked atsetup and as long as the Python environment is running, it runs through fine:

image

image

Thanks

erew123 commented 4 months ago

BTW, if you wish to look at the manual instructions, they are here

Quidam2k commented 4 months ago

Hi! Thanks! I responded to this yesterday, but somehow my comment disappeared- if it reappears and this is a dupe, forgive me.

I know about pip, and a lot of what you suggest I've already tried. I pasted the manual instructions along with the errors I was getting into GPT4 to see if I could avoid having to bother anyone with the issue. Here's what I posted before about what was tried:

Confirmed Python and pip installations, and their correct operation outside of the environment. Verified that the cmd_windows.bat script correctly activates the environment, with pip accessible and PATH including the environment's Scripts directory. Used WHERE PIP to confirm the command prompt prioritizes the environment's pip correctly. Attempted direct execution of pip commands within the activated environment, which worked as expected, suggesting the issue is isolated to the script execution.

So yeah, I'm definitely in the venv, and I've read the instructions and done the baseline troubleshooting to no avail.

erew123 commented 4 months ago

Hi @Quidam2k

So this is very hard for me to recreate as I don't have a machine that has the issue.

Literally, when you are in ATSetup's Text-gen-webui menu and you select 1, the first thing it literally runs is pip and depending if it runs or not, displays an error message or a completed message. So there's nothing special about it.

image

The only environment variable changed is to add set %SystemRoot%\system32 to the existing path. This is done by:

set PATH=%PATH%;%SystemRoot%\system32 which basically says, take the current PATH environment variable and add %SystemRoot%\system32 to it. So that shouldn't change anything odd, however if I guess if there was something odd character wise in your existing system path, it could cause a break it performing the SET command,

As such, I have changed:

set PATH=%PATH%;%SystemRoot%\system32 to set "PATH=%PATH%;%SystemRoot%\system32"

(note the quotes to encapsulate whatever is in PATH already and not break while setting, if there were some odd character (though I have no idea what would cause it to break in such a way).

So you are welcome to git pull inside your alltalk_tts folder, load up your environment cmd_windows.bat and at this point, I would ask that you go to the text-generation-webui\extensions\alltalk_tts\ folder and before you run atsetup.bat please try typing pip and see if you get back the pip screen?

If you don't, then at this point, atsetup.bat is in no way involved, so that would suggest an environment issue with the Python environment.

If pip does work ok, then please try atsetup.bat and see if that works now?

You are welcome to manually run python diagnostics.py in your alltalk_tts folder which is the command to run the diagnostics and generate a diagnositcs.log file. This is detailed and shown here https://github.com/erew123/alltalk_tts/tree/apirework?tab=readme-ov-file#-help-with-problems

Thanks

atani12 commented 4 months ago

Hi, I made a account on Github for this reply.

Would like to confirm the above issue that @Quidam2k has with the script for the text UI extension option (1). Pip (1) or git (2) shown as unrecognized commands. While in the python environment before running atsetup.bat: Python 3.11.8 pip 23.3.1

To install the base requirements I just copied the command from the script - pip install -r system\requirements\requirements_textgen.txt and the installation went fine, just like git pull, so it seems to be something in the script that is creating the problem.

My Windows 10 was installed yesterday and the project was pulled as well, all fresh. The diagnostics report looks good, I can upload it if needed though.

Thank you for looking into this and for the amazing project you share 🙇

erew123 commented 4 months ago

Hi @atani12

The only current factor I can see is you are both on Windows 10 (I test on Windows 11). Perhaps there is something in that, that I don't know about. Ill build up a Windows 10 system and try testing. If you can give me a diagnostics report that would be handy as it will at least let me ensure the environment I build will match your environment, so that I can do a like for like test.

Thanks for feeding back!

atani12 commented 4 months ago

Absolutely, here you go: diagnostics.log

This comes from a really fresh Windows and using the Windows Terminal application installed from the Windows Store.

Thank you

erew123 commented 4 months ago

Hi @atani12 & @Quidam2k

Thanks for the diags @atani12, that helped me rule out/confirm various things.

So, I have a solution. I've updated atsetup.bat and it should do what it claims to do now. The best I can tell there is some difference between something Windows 10 and Windows 11 does at the command prompt with batch files. Something different in the way something is handled. What that is, can I find a tech document to explain a difference, nope! I'm sure there will be some MS bulletin somewhere, but I cant find it.

I've changed the way directory paths with spaces are detected. Tested on Windows 10 and 11 both in and out of the Python environment and all seems to work.

Thanks for both of your replies and info,

atani12 commented 4 months ago

I just gave it a try and it works wonders. Thank you for such a fast fix especially considering the lack of MS documentation.

Quidam2k commented 4 months ago

Many thanks to you both!