watson-developer-cloud / python-sdk

:snake: Client library to use the IBM Watson services in Python and available in pip as watson-developer-cloud
https://pypi.org/project/ibm-watson/
Apache License 2.0
1.45k stars 828 forks source link

Trying to install just meets with failure from setup tools #849

Open Nniol opened 3 months ago

Nniol commented 3 months ago

Overview Unable to install. I have removed all python packages from my computer, created a new venv

Even if as shown I use an older version of setuptools I till get the same error

python -m venv fm_aiortc
.\fm_aiortc\Scripts\activate
pip install ibm_watson
(fm_aiortc) PS C:\Work\GitHubRepo\WatsonX\pilots\FM\orchestration-layer\airotc> pip list
Package    Version
---------- -------
pip        24.2
setuptools 71.0.0
wheel      0.43.0

Expected behavior Install ibm_watson

Actual behavior

(fm_aiortc) PS C:\Work\GitHubRepo\WatsonX\pilots\FM\orchestration-layer\airotc> pip install ibm_watson
Collecting ibm_watson
  Using cached ibm_watson-8.1.0.tar.gz (400 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting requests<3.0,>=2.0 (from ibm_watson)
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting python-dateutil>=2.5.3 (from ibm_watson)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting websocket-client>=1.1.0 (from ibm_watson)
  Using cached websocket_client-1.8.0-py3-none-any.whl.metadata (8.0 kB)
Collecting ibm-cloud-sdk-core==3.*,>=3.3.6 (from ibm_watson)
  Using cached ibm-cloud-sdk-core-3.20.3.tar.gz (62 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
  ╰─> [21 lines of output]
      <string>:18: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      Traceback (most recent call last):
        File "C:\Work\GitHubRepo\WatsonX\pilots\FM\orchestration-layer\airotc\fm_aiortc\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Work\GitHubRepo\WatsonX\pilots\FM\orchestration-layer\airotc\fm_aiortc\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Work\GitHubRepo\WatsonX\pilots\FM\orchestration-layer\airotc\fm_aiortc\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\010488846\AppData\Local\Temp\pip-build-env-pqhwh9x4\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\010488846\AppData\Local\Temp\pip-build-env-pqhwh9x4\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "C:\Users\010488846\AppData\Local\Temp\pip-build-env-pqhwh9x4\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\010488846\AppData\Local\Temp\pip-build-env-pqhwh9x4\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 20, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [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.

How to reproduce Help us to reproduce what you experienced. Include your code snippets (without credentials)

Screenshots If applicable, add screenshots to help explain your problem.

SDK Version 8.1.0

Additional information:

Additional context Add any other details about the problem.

Nniol commented 3 months ago

If I add a constraints.txt file with the following:

setuptools==71.0.0

and run this command: (fm_aiortc) PS C:\Work\GitHubRepo\WatsonX\pilots\FM\orchestration-layer\airotc> pip install --constraint .\constraints.txt ibm_watson

I get the same failure as above

I see that setuptools released a new version a few hours ago, and it appears it is being downloaded no matter what the constraints file says

Nniol commented 3 months ago

Issue also discussed here

https://github.com/astral-sh/uv/issues/5551

Nniol commented 3 months ago

pip install --no-build-isolation --constraint .\constraints.txt ibm_watson

is a work around

benji2512 commented 3 months ago

pip install --no-build-isolation ibm_watson worked for us in both console context and jupyter notebook