wandb / openui

OpenUI let's you describe UI using your imagination, then see it rendered live.
https://openui.fly.dev
Apache License 2.0
17.02k stars 1.5k forks source link

Error in pip install for weave on Mac #66

Open rberger opened 2 months ago

rberger commented 2 months ago

Following the instructions for installing locally on an M1 Mac running Sonoma I get an error with the pip install for weave. I did have to remove .python-version from the top level and from backend and then created a venv than ran the instructions and got the following (tried it a few times, not clear how to fix):

pip install .
Processing /Users/rberger/work/informed/svelte/openui/backend
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting weave@ git+https://github.com/wandb/weave.git@fix/tiktoken-images (from openui==0.2)
  Cloning https://github.com/wandb/weave.git (to revision fix/tiktoken-images) to /private/var/folders/qx/1xwvrcbs7cq7rj74sx947fn40000gp/T/pip-install-2dlfmkyv/weave_b89a99536e694c35aa9c2adc3123a983
  Running command git clone --filter=blob:none --quiet https://github.com/wandb/weave.git /private/var/folders/qx/1xwvrcbs7cq7rj74sx947fn40000gp/T/pip-install-2dlfmkyv/weave_b89a99536e694c35aa9c2adc3123a983
  error: RPC failed; curl 92 HTTP/2 stream 3 was not closed cleanly: CANCEL (err 8)
  error: 7301 bytes of body are still expected
  fetch-pack: unexpected disconnect while reading sideband packet
  fatal: early EOF
  fatal: fetch-pack: invalid index-pack output
  fatal: could not fetch e80ec2c8b1e5721be290a1322836382ce51b973f from promisor remote
  warning: Clone succeeded, but checkout failed.
  You can inspect what was checked out with 'git status'
  and retry with 'git restore --source=HEAD :/'

  error: subprocess-exited-with-error

  × git clone --filter=blob:none --quiet https://github.com/wandb/weave.git /private/var/folders/qx/1xwvrcbs7cq7rj74sx947fn40000gp/T/pip-install-2dlfmkyv/weave_b89a99536e694c35aa9c2adc3123a983 did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

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

× git clone --filter=blob:none --quiet https://github.com/wandb/weave.git /private/var/folders/qx/1xwvrcbs7cq7rj74sx947fn40000gp/T/pip-install-2dlfmkyv/weave_b89a99536e694c35aa9c2adc3123a983 did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
vanpelt commented 2 months ago

Hmm, looks like git or GitHub was messed up. You can replace the weave line in pyproject.toml with just "weave" and it should work. I'll update this week.

fahimzafri commented 2 months ago

@vanpelt Thanks that solved it.

anil2799 commented 2 months ago

Getting error on Mac Book while

pip install .

Error message:

   File "/private/var/folders/pq/ztx62ylj42g9z8czbtj0pzj80000gn/T/pip-build-env-o41p2gp2/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 86, in run
    File "<string>", line 76, in download_frontend
    File "<string>", line 58, in download_and_extract_tarball
  RuntimeError: Couldn't download the tarball https://storage.googleapis.com/wandb-cdn-prod/weave/f9114af272a3b157866ac1b46efa139cd2411de1.tar.gz due to error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for weave Successfully built openui Failed to build weave ERROR: Could not build wheels for weave, which is required to install pyproject.toml-based projects

wanxiyu commented 1 month ago

On the Linux operating system, a Conda virtual environment was set up, and after executing pip install ., the same issue persisted. Error message: Building wheels for collected packages: openui, weave Building wheel for openui (pyproject.toml) ... done Created wheel for openui: filename=openui-0.3.1-py3-none-any.whl size=19940 sha256=6db7be249b3f15b294fa70c04f4461aebfc394fcff2ad8df132be1fbb35c11ab Stored in directory: /tmp/pip-ephem-wheel-cache-9e2jc99i/wheels/a0/07/3f/e811ad4dc1e9e260c3a4fe3d0750514c6d766f56f5462fce95 Building wheel for weave (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for weave (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [98 lines of output] running bdist_wheel running build Traceback (most recent call last): File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 1344, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/home/power/anaconda3/envs/openui/lib/python3.12/http/client.py", line 1336, in request self._send_request(method, url, body, headers, encode_chunked) File "/home/power/anaconda3/envs/openui/lib/python3.12/http/client.py", line 1382, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/home/power/anaconda3/envs/openui/lib/python3.12/http/client.py", line 1331, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/home/power/anaconda3/envs/openui/lib/python3.12/http/client.py", line 1091, in _send_output self.send(msg) File "/home/power/anaconda3/envs/openui/lib/python3.12/http/client.py", line 1035, in send self.connect() File "/home/power/anaconda3/envs/openui/lib/python3.12/http/client.py", line 1477, in connect self.sock = self._context.wrap_socket(self.sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/power/anaconda3/envs/openui/lib/python3.12/ssl.py", line 455, in wrap_socket return self.sslsocket_class._create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/power/anaconda3/envs/openui/lib/python3.12/ssl.py", line 1042, in _create self.do_handshake() File "/home/power/anaconda3/envs/openui/lib/python3.12/ssl.py", line 1320, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 56, in download_and_extract_tarball
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 240, in urlretrieve
      with contextlib.closing(urlopen(url, data)) as fp:
                              ^^^^^^^^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 215, in urlopen
      return opener.open(url, data, timeout)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 515, in open
      response = self._open(req, data)
                 ^^^^^^^^^^^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 532, in _open
      result = self._call_chain(self.handle_open, protocol, protocol +
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 492, in _call_chain
      result = func(*args)
               ^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 1392, in https_open
      return self.do_open(http.client.HTTPSConnection, req,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/urllib/request.py", line 1347, in do_open
      raise URLError(err)
  urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer>

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/power/anaconda3/envs/openui/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/power/anaconda3/envs/openui/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/power/anaconda3/envs/openui/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 410, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 395, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 108, in <module>
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 104, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-uu1waj7t/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "<string>", line 86, in run
    File "<string>", line 76, in download_frontend
    File "<string>", line 58, in download_and_extract_tarball
  RuntimeError: Couldn't download the tarball https://storage.googleapis.com/wandb-cdn-prod/weave/f9114af272a3b157866ac1b46efa139cd2411de1.tar.gz due to error: <urlopen error [Errno 104] Connection reset by peer>
swoopertr commented 1 month ago

is this issue solved? I am getting the same problem

isaganijaen commented 5 days ago

I'm getting this error on window 11 conda env:

(openui) D:\Gani-github\OpenUI\openui\backend>python -m openui
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Gani-github\OpenUI\openui\backend\openui\__main__.py", line 3, in <module>
    from . import server
  File "D:\Gani-github\OpenUI\openui\backend\openui\server.py", line 598, in <module>
    from weave.monitoring import openai as wandb_openai
ModuleNotFoundError: No module named 'weave.monitoring'
Yas246 commented 5 days ago

I'm getting this error on window 11 conda env:

(openui) D:\Gani-github\OpenUI\openui\backend>python -m openui
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Gani-github\OpenUI\openui\backend\openui\__main__.py", line 3, in <module>
    from . import server
  File "D:\Gani-github\OpenUI\openui\backend\openui\server.py", line 598, in <module>
    from weave.monitoring import openai as wandb_openai
ModuleNotFoundError: No module named 'weave.monitoring'

I have same error on windows 11 from source:

C:\Users\Administrator\Documents\GitHub\openui\backend>python -m openui Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\Administrator\Documents\GitHub\openui\backend\openui\__main__.py", line 3, in <module> from . import server File "C:\Users\Administrator\Documents\GitHub\openui\backend\openui\server.py", line 601, in <module> from weave.monitoring import openai as wandb_openai ModuleNotFoundError: No module named 'weave.monitoring'

CrazyJazzHands commented 3 days ago

I'm getting this error on window 11 conda env:

(openui) D:\Gani-github\OpenUI\openui\backend>python -m openui
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Gani-github\OpenUI\openui\backend\openui\__main__.py", line 3, in <module>
    from . import server
  File "D:\Gani-github\OpenUI\openui\backend\openui\server.py", line 598, in <module>
    from weave.monitoring import openai as wandb_openai
ModuleNotFoundError: No module named 'weave.monitoring'

I have same error on windows 11 from source:

C:\Users\Administrator\Documents\GitHub\openui\backend>python -m openui Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\Administrator\Documents\GitHub\openui\backend\openui\__main__.py", line 3, in <module> from . import server File "C:\Users\Administrator\Documents\GitHub\openui\backend\openui\server.py", line 601, in <module> from weave.monitoring import openai as wandb_openai ModuleNotFoundError: No module named 'weave.monitoring'

I get this same error on mac(silicon):

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/Users/XXX/openui/backend/openui/main.py", line 3, in from . import server File "/Users/XXX/openui/backend/openui/server.py", line 598, in from weave.monitoring import openai as wandb_openai ModuleNotFoundError: No module named 'weave.monitoring'

Yueming-Yan commented 3 days ago

Hi all,

I tried the solution mentioned in openui pull 176 change 'weave.monitoring' to 'weave.legacy.monitoring' now I can run 'python -m openui' with no fault hope it helps

CrazyJazzHands commented 2 days ago

I found another way around this. "pip install ." does not install the requirements. So I looked in pyproject.toml and got the dependencies then I put them in file I named 'requirements.txt' like so:

weave==0.50.0 openai==1.12.0 ollama==0.1.7 itsdangerous==2.0.1 peewee==3.0.0 fastapi==0.111.0 uvicorn==0.22.0 fastapi-sso==0.10.0 boto3==1.34.67

Then I ran "pip install -r requirements.txt". I got an error saying pip could not find peewee version 3.0.0 so I changed the peewee line to 'peewee==3.17.5' then did "pip install -r requirements.txt" again. Now it's working. Hope this helps someone.

isaganijaen commented 2 days ago

I found another way around this. "pip install ." does not install the requirements. So I looked in pyproject.toml and got the dependencies then I put them in file I named 'requirements.txt' like so:

weave==0.50.0 openai==1.12.0 ollama==0.1.7 itsdangerous==2.0.1 peewee==3.0.0 fastapi==0.111.0 uvicorn==0.22.0 fastapi-sso==0.10.0 boto3==1.34.67

Then I ran "pip install -r requirements.txt". I got an error saying pip could not find peewee version 3.0.0 so I changed the peewee line to 'peewee==3.17.5' then did "pip install -r requirements.txt" again. Now it's working. Hope this helps someone.

Thanks, @CrazyJazzHands. It worked! 🙌 ✅

What I did:

Went to directory: \openui\backend

Created requirements.txt with the following values:

weave==0.50.0
openai==1.12.0
ollama==0.1.7
itsdangerous==2.0.1
peewee==3.17.5
fastapi==0.111.0
uvicorn==0.22.0
fastapi-sso==0.10.0
boto3==1.34.67

Went back to the terminal and executed the

pip install -r requirements.txt

Then

python -m openui

Done!

CrazyJazzHands commented 2 days ago

I found another way around this. "pip install ." does not install the requirements. So I looked in pyproject.toml and got the dependencies then I put them in file I named 'requirements.txt' like so: weave==0.50.0 openai==1.12.0 ollama==0.1.7 itsdangerous==2.0.1 peewee==3.0.0 fastapi==0.111.0 uvicorn==0.22.0 fastapi-sso==0.10.0 boto3==1.34.67 Then I ran "pip install -r requirements.txt". I got an error saying pip could not find peewee version 3.0.0 so I changed the peewee line to 'peewee==3.17.5' then did "pip install -r requirements.txt" again. Now it's working. Hope this helps someone.

Thanks, @CrazyJazzHands. It worked! 🙌 ✅

What I did:

Went to directory: \openui\backend

Created requirements.txt with the following values:

weave==0.50.0
openai==1.12.0
ollama==0.1.7
itsdangerous==2.0.1
peewee==3.17.5
fastapi==0.111.0
uvicorn==0.22.0
fastapi-sso==0.10.0
boto3==1.34.67

Went back to the terminal and executed the

pip install -r requirements.txt

Then

python -m openui

Done!

Glad you got it to work. Well done! 👏

majt415 commented 1 hour ago

(.venv) admin@MacBook-Pro-2 backend % python -m openui --dev Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/Users/admin/Documents/project/AI/openui/backend/openui/main.py", line 3, in from . import server File "/Users/admin/Documents/project/AI/openui/backend/openui/server.py", line 598, in from weave.monitoring import openai as wandb_openai ModuleNotFoundError: No module named 'weave.monitoring' (.venv) admin@MacBook-Pro-2 backend %

Please help me take a look at this problem~