wsippel / bark_tts

Oobabooga extension for Bark TTS
GNU Affero General Public License v3.0
110 stars 14 forks source link

[issue] nltk seems to not load properly #3

Closed Tom-Neverwinter closed 1 year ago

Tom-Neverwinter commented 1 year ago

ModuleNotFoundError: No module named 'nltk'

adding --extensions bark_tts

the module seems to fail to load this item sadly

Loading the extension "bark_tts"... Fail.
Traceback (most recent call last):
  File "C:\Users\Tom_N\Desktop\oobabooga-windows\oobabooga-windows\text-generation-webui\modules\extensions.py", line 21, in load_extensions
    exec(f"import extensions.{name}.script")
  File "<string>", line 1, in <module>
  File "C:\Users\Tom_N\Desktop\oobabooga-windows\oobabooga-windows\text-generation-webui\extensions\bark_tts\script.py", line 8, in <module>
    import nltk
ModuleNotFoundError: No module named 'nltk'
Loading the extension "gallery"... Ok.
C:\Users\Tom_N\Desktop\oobabooga-windows\oobabooga-windows\installer_files\env\lib\site-packages\gradio\utils.py:875: UserWarning: Expected 2 arguments for function <function cai_chatbot_wrapper at 0x000002AD0958B9A0>, received 0.
  warnings.warn(
C:\Users\Tom_N\Desktop\oobabooga-windows\oobabooga-windows\installer_files\env\lib\site-packages\gradio\utils.py:879: UserWarning: Expected at least 2 arguments for function <function cai_chatbot_wrapper at 0x000002AD0958B9A0>, received 0.
  warnings.warn(

this is a fresh install as of 4 hours ago

Clone this repository into your text-generation-webui/extensions folder, activate the virtual environment, install the requirements and launch the web UI with --extension bark_tts

I'm assuming I'm installing to the wrong virtual enviroment.

assume user doesnt know how to use python and python.exe doesnt get the user what they want.

The correct item to run the pip install command is "C:\Users\user\Desktop\oobabooga-windows\oobabooga-windows\installer_files\env\Scripts\pip.exe".

You can open a command prompt or terminal window, navigate to the directory where your Python environment is located ("C:\Users\user\Desktop\oobabooga-windows\oobabooga-windows\installer_files\env\") and then run the pip command using the full path to the pip.exe file. For example, to install the nltk package, you can run the following command:

bash Copy code C:\Users\user\Desktop\oobabooga-windows\oobabooga-windows\installer_files\env\Scripts\pip.exe install nltk Note that you should replace nltk with the name of the package you want to install.

wsippel commented 1 year ago

Read the Windows section of the installation instructions. I'm not entirely sure the instructions are correct, but I don't use Windows so I can't really help with installation issues on Windows.

MiniCoperations commented 1 year ago

Just going to jump in since this isn't marked as closed so I assume you never fixed it,

I can perfectly recreate the error from my working setup by running pip uninstall nltk in the cmd window that the micromamba-cmd.bat file opens, and consequently I am able to resolve it again by simply running pip install nltk in the aforementioned window.

If this resolves your issue, I have no idea why your installation would not have installed this (I presume this would've been installed with everything when installing requirements or something, I certainly haven't gone out of my way to install it anyway) but running that command seems to be a solution as far as I can see.

If not, try following the instructions again, you should only ever need to open the micromamba-cmd.bat file for the whole installation process (other than running the webui after of course) and don't need to use any other cmd window, or manually move any files around, it should all just kind of work. (delete anything to do with bark_tts living in your extensions folder before trying again, just in case)

Tom-Neverwinter commented 1 year ago

yeah I'm not certain why its not installing normally. trying to investigate, hopefully I can find out why and help others in the future

Tom-Neverwinter commented 1 year ago

I think this is an issue with AMD CPUs on windows, as I have similar issue in other projects or project versions like infinite and suno source.

MiniCoperations commented 1 year ago

I think this is an issue with AMD CPUs on windows, as I have similar issue in other projects or project versions like infinite and suno source.

That would surprise me somewhat, I use a Ryzen 3900x on Windows 11 and only have ever seen the error when I manually created the conditions for it, I guess it's possible I may have installed it nltk at somepoint without knowing in the past but I find it very unlikely honestly.

Tom-Neverwinter commented 1 year ago

the solution is run this from the miniconda in the obabooga directory, this will install to its pyenv automatically.

installing from outside seems to incorrectly link to a different env when it changes items or restarts to complete installs

MiniCoperations commented 1 year ago

I have rewritten the Windows installation instructions to hopefully clear up any installation issues like this. I hope that they are clear enough.

I believe this issue can now be marked as closed.

wsippel commented 1 year ago

Yep. :smiley: