torchchat icon indicating copy to clipboard operation
torchchat copied to clipboard

Can't install requirements when using Python-3.12

Open malfet opened this issue 6 months ago • 4 comments

🐛 Describe the bug

pip install fails because it could not find torch even though, it's present in the environment:

% pip install git+https://github.com/pytorch/ao.git@d36de1b144b73bf753bd082109c2b5d0141abd5b 
Collecting git+https://github.com/pytorch/ao.git@d36de1b144b73bf753bd082109c2b5d0141abd5b
  Cloning https://github.com/pytorch/ao.git (to revision d36de1b144b73bf753bd082109c2b5d0141abd5b) to /private/var/folders/rk/fxg20zvx6vvb5bk7cplq4xrc0000gn/T/pip-req-build-r05jkt6n
  Running command git clone --filter=blob:none --quiet https://github.com/pytorch/ao.git /private/var/folders/rk/fxg20zvx6vvb5bk7cplq4xrc0000gn/T/pip-req-build-r05jkt6n
  Running command git rev-parse -q --verify 'sha^d36de1b144b73bf753bd082109c2b5d0141abd5b'
  Running command git fetch -q https://github.com/pytorch/ao.git d36de1b144b73bf753bd082109c2b5d0141abd5b
  Running command git checkout -q d36de1b144b73bf753bd082109c2b5d0141abd5b
  Resolved https://github.com/pytorch/ao.git to commit d36de1b144b73bf753bd082109c2b5d0141abd5b
  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
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/Users/nshulga/py3.12-torch2.4/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/nshulga/py3.12-torch2.4/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 "/Users/nshulga/py3.12-torch2.4/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/rk/fxg20zvx6vvb5bk7cplq4xrc0000gn/T/pip-build-env-x_bm22ut/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/rk/fxg20zvx6vvb5bk7cplq4xrc0000gn/T/pip-build-env-x_bm22ut/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/rk/fxg20zvx6vvb5bk7cplq4xrc0000gn/T/pip-build-env-x_bm22ut/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/rk/fxg20zvx6vvb5bk7cplq4xrc0000gn/T/pip-build-env-x_bm22ut/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 31, in <module>
      ModuleNotFoundError: No module named 'torch'
      [end of output]

Versions

CI

malfet avatar Jul 29 '24 20:07 malfet