Getting requirements to build wheel did not run successfully exit code: 1

Hi all,
I am trying to install pip install “ai-core-sdk[aicore-content]” while building meter reading model ,so i am following a blog , while executing command to install ai core sdk on virtual machine linux , I am facing error as follow

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.

please help me regarding this issue
my output of running command

(sap_cv_env) sapaicore2023@sapaicore2023-VirtualBox:~$ pip install “ai-core-sdk[aicore-content]”
Requirement already satisfied: ai-core-sdk[aicore-content] in ./sap_cv_env/lib/python3.11/site-packages (1.22.3)
Requirement already satisfied: ai-api-client-sdk==1.28.0 in ./sap_cv_env/lib/python3.11/site-packages (from ai-core-sdk[aicore-content]) (1.28.0)
Collecting sap-ai-core-metaflow[kubernetes]~=1.1.1
Using cached sap_ai_core_metaflow-1.1.14-py3-none-any.whl (23 kB)
Collecting click~=8.0.4
Using cached click-8.0.4-py3-none-any.whl (97 kB)
Collecting awscli~=1.22.94
Using cached awscli-1.22.101-py3-none-any.whl (3.8 MB)
Collecting python-dotenv~=0.19.2
Using cached python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB)
Requirement already satisfied: aenum~=3.1 in ./sap_cv_env/lib/python3.11/site-packages (from ai-api-client-sdk==1.28.0->ai-core-sdk[aicore-content]) (3.1.15)
Requirement already satisfied: pyhumps~=3.0 in ./sap_cv_env/lib/python3.11/site-packages (from ai-api-client-sdk==1.28.0->ai-core-sdk[aicore-content]) (3.8.0)
Requirement already satisfied: requests<3.0 in ./sap_cv_env/lib/python3.11/site-packages (from ai-api-client-sdk==1.28.0->ai-core-sdk[aicore-content]) (2.31.0)
Collecting botocore==1.24.46
Using cached botocore-1.24.46-py3-none-any.whl (8.7 MB)
Collecting docutils<0.16,>=0.10
Using cached docutils-0.15.2-py3-none-any.whl (547 kB)
Collecting s3transfer<0.6.0,>=0.5.0
Using cached s3transfer-0.5.2-py3-none-any.whl (79 kB)
Collecting PyYAML<5.5,>=3.10
Using cached PyYAML-5.4.1.tar.gz (175 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
╰─> [68 lines of output]
/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg
!!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.
  
          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3/PyYAML.egg-info/PKG-INFO
  writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
  writing top-level names to lib3/PyYAML.egg-info/top_level.txt
  Traceback (most recent call last):
    File "/home/sapaicore2023/sap_cv_env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/home/sapaicore2023/sap_cv_env/lib/python3.11/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/sapaicore2023/sap_cv_env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 314, in run
      self.find_sources()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 322, in find_sources
      mm.run()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 551, in run
      self.add_defaults()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
      sdist.add_defaults(self)
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 104, in add_defaults
      super().add_defaults()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 201, in get_source_files
    File "/tmp/pip-build-env-5_0qfonb/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  [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.

I believe this is due to the recent release of Cython 3.0.0, which the package you’re installing apparently isn’t ready for :slight_smile:

Try the following:

$ echo "Cython<3" > cython_constraint.txt
$ PIP_CONSTRAINT=cython_constraint.txt pip install "ai-core-sdk[aicore-content]"

Note that you need to set the constraint file via the environment variable so that it propagates to the build env.

8 Likes

Thanks this worked brilliantly for me too :slight_smile:

just for my learning can you help me with two doubts

  1. How were you able to identify that this error was due to Cython 3.0.0 ?
  2. At a highlevel what are existing packages not ready with in Cython 3.0.0?

Just experience; I hit the same kind of thing in the brief window between the releases of Cython 3.0.0 and PyYAML 6.0.1 (which pinned Cython to <3.0 in its build dependencies).

No idea :slight_smile: . As far as I can tell, something changed in the way Cython 3.0 interacts with setuptools, but that’s as far as I understand the situation.

1 Like

Hello, i get the same error for my Python 3.11 , working with Pycharm.
Is there any other solution? I struggle with installing pymc with the same error message.

Kind regards

Sir, i am facing same issue in windows. can you help me how to resolve issue in windows .

It’s the same advice on Windows as otherwise, just a matter of creating the constraint file and setting the environment variable to its path.