Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.3k stars 2.37k forks source link

Qiskit install fails on LinuxOne RHEL 9.1 Python 3.12 #13376

Open jwoehr opened 3 weeks ago

jwoehr commented 3 weeks ago

Environment

What is happening?

pip install qiskit seems to fail in z3 ... and there is no z3 package via DNF on LinuxOne RHEL 9.1

Collecting z3-solver>=4.7 (from qiskit[all])
  Downloading z3_solver-4.13.3.0.tar.gz (4.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.9/4.9 MB 42.7 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      <string>:256: SyntaxWarning: invalid escape sequence '\_'
      running dist_info
      creating /tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info
      writing /tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/requires.txt
      writing top-level names to /tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      writing manifest file '/tmp/pip-modern-metadata-ky6q36yx/z3_solver.egg-info/SOURCES.txt'
      creating '/tmp/pip-modern-metadata-ky6q36yx/z3_solver-4.13.3.0.dist-info'
      Traceback (most recent call last):
        File "/home/linux1/work/Qiskit/qiskit_venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/linux1/work/Qiskit/qiskit_venv/lib64/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/linux1/work/Qiskit/qiskit_venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 373, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 292, in <module>
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 183, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 991, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/command/dist_info.py", line 98, in run
          bdist_wheel = self.get_finalized_command('bdist_wheel')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 303, in get_finalized_command
          cmd_obj.ensure_finalized()
        File "/tmp/pip-build-env-nm4ykl7s/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "<string>", line 288, in finalize_options
      KeyError: ('linux', 's390x')
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

How can we reproduce the issue?

  1. Create and activate Python 3.12 venv on LinuxOne RHEL 9.1
  2. pip install qiskit

What should happen?

Should install

Any suggestions?

@mtreinish to the rescue?

jakelishman commented 3 weeks ago

We don't depend on z3 - it's just an optional. Can you pip install qiskit (no extras) without issue?

jakelishman commented 3 weeks ago

(Your post says pip install qiskit, but your error message says pip install 'qiskit[all]'.)

jwoehr commented 3 weeks ago

Oops, you're right ... fixed that ... So now it dies here:

Building wheels for collected packages: symengine
  Building wheel for symengine (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      /usr/lib/python3.12/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!

              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************

      !!
        dist.fetch_build_eggs(dist.setup_requires)
      running bdist_wheel
      running build
      running build_ext
      -- The C compiler identification is GNU 11.4.1
      -- The CXX compiler identification is GNU 11.4.1
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/gcc - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Error at CMakeLists.txt:16 (find_package):
        Could not find a package configuration file provided by "SymEngine"
        (requested version 0.8.1) with any of the following names:

          SymEngineConfig.cmake
          symengine-config.cmake

        Add the installation prefix of "SymEngine" to CMAKE_PREFIX_PATH or set
        "SymEngine_DIR" to a directory containing one of the above files.  If
        "SymEngine" provides a separate development package or SDK, be sure it has
        been installed.

      -- Configuring incomplete, errors occurred!
      error: error calling cmake
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for symengine
  Running setup.py clean for symengine
Failed to build symengine
ERROR: Could not build wheels for symengine, which is required to install pyproject.toml-based projects
jwoehr commented 3 weeks ago

Did:

 pip install pep517
pip install --use-pep517 qiskit --no-cache-dir

and it still doesn't install

Building wheels for collected packages: symengine
  Building wheel for symengine (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for symengine (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      /home/linux1/work/Qiskit/qiskit_venv/lib64/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py:251: _IncompatibleBdistWheel: wheel.bdist_wheel is deprecated, please import it from setuptools
      !!

              ********************************************************************************
              Ensure that any custom bdist_wheel implementation is a subclass of
              setuptools.command.bdist_wheel.bdist_wheel.

              By 2025-Oct-15, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://github.com/pypa/wheel/pull/631 for details.
              ********************************************************************************

      !!
        return _build_backend().build_wheel(wheel_directory, config_settings,
      running bdist_wheel
      running build
      running build_ext
      -- The C compiler identification is GNU 11.4.1
      -- The CXX compiler identification is GNU 11.4.1
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/gcc - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Error at CMakeLists.txt:16 (find_package):
        Could not find a package configuration file provided by "SymEngine"
        (requested version 0.8.1) with any of the following names:

          SymEngineConfig.cmake
          symengine-config.cmake

        Add the installation prefix of "SymEngine" to CMAKE_PREFIX_PATH or set
        "SymEngine_DIR" to a directory containing one of the above files.  If
        "SymEngine" provides a separate development package or SDK, be sure it has
        been installed.

      -- Configuring incomplete, errors occurred!
      error: error calling cmake
      [end of output]

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