text-generation-webui icon indicating copy to clipboard operation
text-generation-webui copied to clipboard

ModuleNotFoundError: No module named 'gradio'

Open ShmuelRonen opened this issue 1 year ago • 14 comments

Need help...

I installe oobabooga-windows without GPU, and I got this message when i start start-webui.bat

Starting the web UI... Traceback (most recent call last): File "C:\Users\derec\OneDrive\Desktop\oobabooga\oobabooga-windows\text-generation-webui\server.py", line 14, in import gradio as gr ModuleNotFoundError: No module named 'gradio' Press any key to continue . . .

ShmuelRonen avatar Apr 06 '23 21:04 ShmuelRonen

same issue here

Adel1525 avatar Apr 06 '23 21:04 Adel1525

same

Kryptonic83 avatar Apr 06 '23 21:04 Kryptonic83

same, I also run into an error when using "pip install -r isntall requirements.txt" , everything goes well until the "getting requirements to build wheel"

pip install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/huggingface/transformers (from -r requirements.txt (line 16))
  Cloning https://github.com/huggingface/transformers to c:\users\thefairyman\appdata\local\temp\pip-req-build-6sksqzo5
  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/transformers 'C:\Users\TheFairyMan\AppData\Local\Temp\pip-req-build-6sksqzo5'
  Resolved https://github.com/huggingface/transformers to commit c7ec71baf517796559bbf2ef97f9b2c65fcca103
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting accelerate==0.18.0
  Using cached accelerate-0.18.0-py3-none-any.whl (215 kB)
Collecting bitsandbytes==0.37.2
  Using cached bitsandbytes-0.37.2-py3-none-any.whl (84.2 MB)
Collecting datasets
  Using cached datasets-2.11.0-py3-none-any.whl (468 kB)
Collecting flexgen==0.1.7
  Using cached flexgen-0.1.7-py3-none-any.whl (50 kB)
Collecting gradio==3.24.1
  Using cached gradio-3.24.1-py3-none-any.whl (15.7 MB)
Collecting llama-cpp-python==0.1.23
  Using cached llama_cpp_python-0.1.23.tar.gz (530 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "C:\ProgramData\miniconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
          main()
        File "C:\ProgramData\miniconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\ProgramData\miniconda3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\TheFairyMan\AppData\Local\Temp\pip-build-env-dd4va1_8\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\TheFairyMan\AppData\Local\Temp\pip-build-env-dd4va1_8\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "C:\Users\TheFairyMan\AppData\Local\Temp\pip-build-env-dd4va1_8\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 6, in <module>
        File "C:\ProgramData\miniconda3\lib\pathlib.py", line 1135, in read_text
          return f.read()
      UnicodeDecodeError: 'cp932' codec can't decode byte 0x99 in position 5: illegal multibyte sequence
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

TheFairyMan avatar Apr 06 '23 21:04 TheFairyMan

I spoke too soon, not fixed.

This fixed it for me.

pm4user444 avatar Apr 06 '23 21:04 pm4user444

Side-effect of https://github.com/oobabooga/text-generation-webui/commit/03cb44fc8ca24c6458dbd25c31acd1e8cbdfcde2 I guess

EyeDeck avatar Apr 06 '23 21:04 EyeDeck

Get into the main Chat folder you created and then open a CMD window. Or open a CMD window and CD to the C:\Chat folder.

Type: pip install gradio

This fixed it for me.

tried it but didn't work P.S "when installing i had problems building wheels for llama-cpp-python" Screenshot 2023-04-06 234429

Adel1525 avatar Apr 06 '23 21:04 Adel1525

Side-effect of 03cb44f I guess

Yes, that was it. I have removed the requirement from now https://github.com/oobabooga/text-generation-webui/commit/58ed87e5d9dd864e38d346274e6455a4a041e203

oobabooga avatar Apr 06 '23 21:04 oobabooga

this worked for me https://github.com/oobabooga/text-generation-webui/issues/835#issuecomment-1499514571 #835 run the micromamba-cmd.bat file pip install gradio then after that there were some other dependencies missing: pip install markdown peft protobuf then i was able to launch start-webui.bat properly

Kryptonic83 avatar Apr 06 '23 21:04 Kryptonic83

this worked for me #835 (comment) #835 run the micromamba-cmd.bat file pip install gradio then after that there were some other dependencies missing: pip install markdown peft protobuf then i was able to launch start-webui.bat properly

CAN CONFIRM, you need to run those commands in the CMD box the micromaba-cmd bat makes.

pm4user444 avatar Apr 06 '23 22:04 pm4user444

Thanks!! it work 4 me

ShmuelRonen avatar Apr 07 '23 09:04 ShmuelRonen

I'm on ubuntu 20.04 with microconda. Installed all the requirements and infact pip says gradio is intalled yet when I run server.py I get gradio is missing.

tapir avatar Apr 16 '23 10:04 tapir

I'm on ubuntu 20.04 with microconda. Installed all the requirements and infact pip says gradio is intalled yet when I run server.py I get gradio is missing.

Same here, on Centos 7

csprocket777 avatar Apr 28 '23 15:04 csprocket777

I've figured it out. For some reason microconda installation is not working correctly on ubuntu 20.04. It still searches the host python environment for gradio instead of the conda environment. I've installed the conda from their repos and that didn't give any problem.

tapir avatar Apr 28 '23 15:04 tapir

Same issue.

kodra-dev avatar May 06 '23 14:05 kodra-dev

Ubuntu WSL: make sure you have build-essentials, sudo apt install python3-pip, run sudo ./update_linux.sh., sudo ./start_linux.sh (chmod u+x as needed to make ./ executable). It works, I mean I'm probably doing it wrong though because I'm not running it in an env.

AuroraDizon avatar Sep 11 '23 21:09 AuroraDizon

This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment.

github-actions[bot] avatar Nov 10 '23 23:11 github-actions[bot]

>UnicodeDecodeError: 'cp932' codec can't decode byte 0xXX in position 5: illegal multibyte sequence

このエラーが出るのは日本語WINDOWSの場合のみで UTF-8で書かれたものをCP932で読みだしてる為です

下記の対処は問題があるので #4947の対処をした方がいいと思います

以下のリンクで対処方法がありますが https://webnation.co.jp/windows%E3%81%AE%E6%97%A5%E6%9C%AC%E8%AA%9E%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E5%BC%B7%E5%88%B6%E7%9A%84%E3%81%AButf-8%E3%81%AB%E6%9B%B8%E3%81%8D%E6%8F%9B%E3%81%88%E3%82%8B/

一応リンク切れ対処で簡易に説明を入れておきます

設定方法 設定は簡単でwindows環境での設定となりますが「設定->時計と言語->言語と地域->管理用言語の設定」を開きUnicode対応ではないプログラム言語のシステムロケールの変更を押したのち「ワールドワイド言語サポートでUnicode UTF-8を使用」をチェックして更新後Windowsを再起動します。

注意点としては UTF-8をデフォルトにすると CP932で読む(Shift-JIS)で書かれたテキストが文字化けで読めなくなる可能性があるので Shift-JISをUTF-8に変換する必要があるかもしれません

Nyandaro avatar Dec 16 '23 01:12 Nyandaro