Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Getting started page installation from source terra is incorrect #1624

Closed
tj-amano opened this issue Oct 30, 2022 · 4 comments · Fixed by #1625
Closed

Getting started page installation from source terra is incorrect #1624

tj-amano opened this issue Oct 30, 2022 · 4 comments · Fixed by #1625
Labels
bug Something isn't working documentation Something is not clear or error in description

Comments

@tj-amano
Copy link

Informations

What is the current behavior?

I would like to contribute to the qiskit development. First of all, I built qiskit-terra from the source.
During the qiskit installation process, when I run this command pip install . it returns the following error.

Processing /Users/tj/project/qiskit-terra
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: numpy>=1.17 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (1.23.4)
Requirement already satisfied: stevedore>=3.0.0 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (4.1.0)
Requirement already satisfied: scipy>=1.5 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (1.9.3)
Requirement already satisfied: retworkx>=0.11.0 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (0.12.0)
Requirement already satisfied: python-dateutil>=2.8.0 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (2.8.2)
Requirement already satisfied: sympy>=1.3 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (1.11.1)
Requirement already satisfied: psutil>=5 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (5.9.3)
Requirement already satisfied: dill>=0.3 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (0.3.6)
Requirement already satisfied: symengine>=0.9 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (0.9.2)
Requirement already satisfied: ply>=3.10 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from qiskit-terra==0.23.0) (3.11)
Requirement already satisfied: six>=1.5 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from python-dateutil>=2.8.0->qiskit-terra==0.23.0) (1.16.0)
Requirement already satisfied: rustworkx==0.12.0 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from retworkx>=0.11.0->qiskit-terra==0.23.0) (0.12.0)
Requirement already satisfied: pbr!=2.1.0,>=2.0.0 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from stevedore>=3.0.0->qiskit-terra==0.23.0) (5.11.0)
Requirement already satisfied: mpmath>=0.19 in /Users/tj/.venv/qiskit-dev/lib/python3.9/site-packages (from sympy>=1.3->qiskit-terra==0.23.0) (1.2.1)
Building wheels for collected packages: qiskit-terra
  Building wheel for qiskit-terra (pyproject.toml): started
  Building wheel for qiskit-terra (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for qiskit-terra (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [83 lines of output]
      running bdist_wheel
      running build
      running build_py
      running egg_info
      writing qiskit_terra.egg-info/PKG-INFO
      writing dependency_links to qiskit_terra.egg-info/dependency_links.txt
      writing entry points to qiskit_terra.egg-info/entry_points.txt
      writing requirements to qiskit_terra.egg-info/requires.txt
      writing top-level names to qiskit_terra.egg-info/top_level.txt
      reading manifest file 'qiskit_terra.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching 'qiskit/schemas/*.json'
      warning: no files found matching 'qiskit/schemas/examples/*.json'
      warning: no files found matching '*.pyx' under directory 'qiskit'
      warning: no files found matching '*.pxd' under directory 'qiskit'
      warning: no files found matching 'test/python/pickles/*.pickle'
      adding license file 'LICENSE.txt'
      writing manifest file 'qiskit_terra.egg-info/SOURCES.txt'
      /private/var/folders/12/r2kqphbx64l3m7464rpq2lhh0000gn/T/pip-build-env-e9q2nzpg/overlay/lib/python3.9/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'qiskit.qasm.libs' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'qiskit.qasm.libs' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'qiskit.qasm.libs' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'qiskit.qasm.libs' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      /private/var/folders/12/r2kqphbx64l3m7464rpq2lhh0000gn/T/pip-build-env-e9q2nzpg/overlay/lib/python3.9/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'qiskit.visualization.circuit.styles' as data is deprecated, please list it in `packages`.
          !!
      
      
          ############################
          # Package would be ignored #
          ############################
          Python recognizes 'qiskit.visualization.circuit.styles' as an importable package,
          but it is not listed in the `packages` configuration of setuptools.
      
          'qiskit.visualization.circuit.styles' has been automatically added to the distribution only
          because it may contain data files, but this behavior is likely to change
          in future versions of setuptools (and therefore is considered deprecated).
      
          Please make sure that 'qiskit.visualization.circuit.styles' is included as a package by using
          the `packages` configuration field or the proper discovery methods
          (for example by using `find_namespace_packages(...)`/`find_namespace:`
          instead of `find_packages(...)`/`find:`).
      
          You can read more about "package discovery" and "data files" on setuptools
          documentation page.
      
      
      !!
      
        check.warn(importable)
      running build_ext
      running build_rust
      error: can't find Rust compiler
      
      If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
      
      To update pip, run:
      
          pip install --upgrade pip
      
      and then retry package installation.
      
      If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for qiskit-terra
Failed to build qiskit-terra
ERROR: Could not build wheels for qiskit-terra, which is required to install pyproject.toml-based projects

Steps to reproduce the problem

  • clone qiskit-terra from https://github.com/Qiskit/qiskit-terra
  • make python virtual environment for qiskit-dev python -m venv ~/.venv/qiskit-dev
  • upgrading pip, pip install cython, refer to getting started
  • run pip install .

What is the expected behavior?

Complete the installation without any errors.

Suggested solutions

After this error, I checked the qiskit-terre directory and found a few python libraries (wheel, wheel pyproject.toml setuptools setuptools-rust)missing. I installed these libraries, but the result was no different.

@tj-amano tj-amano added the bug Something isn't working label Oct 30, 2022
@mtreinish
Copy link
Member

To build/install Qiskit terra from source you will need to install the rust compiler. If you read through the error message you pasted it says that the rust compiler was not found:

  error: can't find Rust compiler

The instructions on building from source in the terra specific contributing guide:

https://github.com/Qiskit/qiskit-terra/blob/main/CONTRIBUTING.md#installing-qiskit-terra-from-source

mentions this. Basically you just use rustup to install the rust compiler and if you rerun pip it should work then.

It does look like the hosted documentation on installing from source here: https://qiskit.org/documentation/getting_started.html#install-qiskit-terra is wrong and doesn't mention this. I definitely updated this in #1439, it must have gotten lost in a subsequent documentation refractor. We should fix that so the instructions actually work.

@tj-amano
Copy link
Author

After the installation of rust compiler, the build process is successfully done!

I read "getting started" but could not check carefully "CONTRIBUTING.md".
Your comment was very helpful, and the problem was resolved.

@mtreinish
Copy link
Member

Ok cool, I'm glad you got it working. I'm going to reopen this issue to track the incorrect getting started guide. We can close it again when we fix the getting started page, because what is there is inaccurate.

@mtreinish mtreinish reopened this Oct 30, 2022
@mtreinish mtreinish added the documentation Something is not clear or error in description label Oct 30, 2022
@mtreinish mtreinish changed the title ERROR: Failed building qiskit-terra from source Getting started page installation from source terra is incorrect Oct 30, 2022
@tj-amano
Copy link
Author

I understand.
Sorry for closing without notifying you.

mtreinish added a commit to mtreinish/qiskit that referenced this issue Oct 31, 2022
In Qiskit#1439 we updated the install from source documentation to reflect
recent (as in the last year) changes to the build process and ensure the
documentation was correct for installing from source. However, in Qiskit#1507
where some of the documentation was refactored these changes were
inadvertadntly delete. This commit restores the correct source
installation instructions from Qiskit#1439 so that the hosted docs correctly
document how to build and install qiskit from source.

Fixes Qiskit#1624
@mergify mergify bot closed this as completed in #1625 Nov 1, 2022
mergify bot pushed a commit that referenced this issue Nov 1, 2022
* Fix install from source docs

In #1439 we updated the install from source documentation to reflect
recent (as in the last year) changes to the build process and ensure the
documentation was correct for installing from source. However, in #1507
where some of the documentation was refactored these changes were
inadvertadntly delete. This commit restores the correct source
installation instructions from #1439 so that the hosted docs correctly
document how to build and install qiskit from source.

Fixes #1624

* Update docs/getting_started.rst

* Remove unnecessary pip install from aer instructions
jakelishman pushed a commit to jakelishman/qiskit-terra that referenced this issue Aug 11, 2023
* Fix install from source docs

In Qiskit/qiskit-metapackage#1439 we updated the install from source documentation to reflect
recent (as in the last year) changes to the build process and ensure the
documentation was correct for installing from source. However, in Qiskit/qiskit-metapackage#1507
where some of the documentation was refactored these changes were
inadvertadntly delete. This commit restores the correct source
installation instructions from Qiskit/qiskit-metapackage#1439 so that the hosted docs correctly
document how to build and install qiskit from source.

Fixes Qiskit/qiskit-metapackage#1624

* Update docs/getting_started.rst

* Remove unnecessary pip install from aer instructions
SamD-1998 pushed a commit to SamD-1998/qiskit-terra that referenced this issue Sep 7, 2023
* Fix install from source docs

In Qiskit/qiskit-metapackage#1439 we updated the install from source documentation to reflect
recent (as in the last year) changes to the build process and ensure the
documentation was correct for installing from source. However, in Qiskit/qiskit-metapackage#1507
where some of the documentation was refactored these changes were
inadvertadntly delete. This commit restores the correct source
installation instructions from Qiskit/qiskit-metapackage#1439 so that the hosted docs correctly
document how to build and install qiskit from source.

Fixes Qiskit/qiskit-metapackage#1624

* Update docs/getting_started.rst

* Remove unnecessary pip install from aer instructions
Eric-Arellano pushed a commit to Qiskit/documentation that referenced this issue Oct 12, 2023
* Fix install from source docs

In Qiskit/qiskit-metapackage#1439 we updated the install from source documentation to reflect
recent (as in the last year) changes to the build process and ensure the
documentation was correct for installing from source. However, in Qiskit/qiskit-metapackage#1507
where some of the documentation was refactored these changes were
inadvertadntly delete. This commit restores the correct source
installation instructions from Qiskit/qiskit-metapackage#1439 so that the hosted docs correctly
document how to build and install qiskit from source.

Fixes Qiskit/qiskit-metapackage#1624

* Update docs/getting_started.rst

* Remove unnecessary pip install from aer instructions
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Something is not clear or error in description
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants