oobabooga / text-generation-webui

A Gradio web UI for Large Language Models.
GNU Affero General Public License v3.0
40.84k stars 5.34k forks source link

ModuleNotFoundError: No module named 'requests' #6198

Open Bluenochian opened 4 months ago

Bluenochian commented 4 months ago

Describe the bug

It'll be my first time using it, I am currently using Automatic1111 and Forge for StableDiffusion and I understand a couple of things and have some needed things like Python and git installed but when I open start_windows.bat I am having this issue:


  • WARNING: You haven't downloaded any model yet.
  • Once the web UI launches, head over to the "Model" tab and download one.

Traceback (most recent call last): File "C:\text-generation-webui-1.7\server.py", line 5, in from modules.block_requests import OpenMonkeyPatch, RequestBlocker File "C:\text-generation-webui-1.7\modules\block_requests.py", line 4, in import requests ModuleNotFoundError: No module named 'requests' Press any key to continue . . .

I kept experiencing the same issue repeatedly, even after the requirements had finished downloading and displayed 'Requirement already satisfied' (I tried it several more times to be sure). Regardless of my efforts and hours of research, the problem persisted. And no matter what I do, the issue is still there

I even did some extra steps for that which is:

  • [1 ] Downloaded and installed Anaconda manually checking the make a PATH option.
  • [2 ] Downloaded and installed the latest version of Python again checking the make a PATH option.
  • [3 ] Lastly I came back to the original folder and opened the terminal and used python -m pip uninstall -r ./requirements.txt to remove all the requirements to make sure there is no corruption, then I did python -m pip install -r ./requirements.txt and this did not fix the issue either.

Still the same... Any help is appreciated!

Is there an existing issue for this?

Reproduction

Just a resh installation followed by the instructions without exception.

Screenshot

image

Logs

This is the start_windows.bat log:

*******************************************************************
* WARNING: You haven't downloaded any model yet.
* Once the web UI launches, head over to the "Model" tab and download one.
*******************************************************************

Traceback (most recent call last):
  File "C:\text-generation-webui-1.7\server.py", line 5, in <module>
    from modules.block_requests import OpenMonkeyPatch, RequestBlocker
  File "C:\text-generation-webui-1.7\modules\block_requests.py", line 4, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
Press any key to continue . . .

System Info

GPU: Nvidia GeForce 3050 6GB Laptop GPU
Bluenochian commented 4 months ago

I fixed it by deleting everything and doing a fresh install, and voila, it's fixed!

It was clearly related to the steps I followed earlier (for anyone who might need it in the future):

[1] Manually downloaded and installed Anaconda, ensuring to check the 'Add to PATH' option. [2] Downloaded and installed the latest version of Python, again checking the 'Add to PATH' option.