Qiskit / qiskit-metapackage

Qiskit is an open-source SDK for working with quantum computers at the level of circuits, algorithms, and application modules.
https://qiskit.org
Apache License 2.0
3.03k stars 749 forks source link

Error at qiskit-terra when installing qiskit via pipenv #1341

Closed HectorMenezes closed 3 years ago

HectorMenezes commented 3 years ago

Informations

What is the current behavior?

When trying to install qiskit gives in a pipenv virtual environment by:

$ pipenv install qiskit

Gives the following error:

Installing qiskit…
Collecting qiskit
  Downloading qiskit-0.30.1.tar.gz (13 kB)
Collecting qiskit-aer==0.9.0
  Downloading qiskit_aer-0.9.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (17.9 MB)
Collecting qiskit-aqua==0.9.5
  Using cached qiskit_aqua-0.9.5-py3-none-any.whl (2.1 MB)
Collecting qiskit-ibmq-provider==0.16.0
  Using cached qiskit_ibmq_provider-0.16.0-py3-none-any.whl (235 kB)
Collecting qiskit-ignis==0.6.0
  Using cached qiskit_ignis-0.6.0-py3-none-any.whl (207 kB)
Collecting qiskit-terra==0.18.3
  Downloading qiskit_terra-0.18.3-cp39-cp39-manylinux2010_x86_64.whl (6.2 MB)
Requirement already satisfied: scipy>=1.0 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from qiskit-aer==0.9.0->qiskit) (1.7.1)
Collecting pybind11>=2.6
  Downloading pybind11-2.8.0-py2.py3-none-any.whl (207 kB)
Requirement already satisfied: numpy>=1.16.3 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from qiskit-aer==0.9.0->qiskit) (1.21.2)
Collecting docplex>=2.21.207
  Downloading docplex-2.22.213.tar.gz (634 kB)
Collecting yfinance>=0.1.62
  Using cached yfinance-0.1.63.tar.gz (26 kB)
Collecting pandas
  Downloading pandas-1.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB)
Collecting fastdtw<=0.3.4
  Using cached fastdtw-0.3.4.tar.gz (133 kB)
Requirement already satisfied: setuptools>=40.1.0 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from qiskit-aqua==0.9.5->qiskit) (44.0.0)
Requirement already satisfied: scikit-learn>=0.20.0 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from qiskit-aqua==0.9.5->qiskit) (0.24.2)
Collecting dlx<=1.0.4
  Using cached dlx-1.0.4.tar.gz (5.5 kB)
Collecting retworkx>=0.8.0
  Downloading retworkx-0.10.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB)
Collecting h5py<3.3.0
  Downloading h5py-3.2.1-cp39-cp39-manylinux1_x86_64.whl (4.5 MB)
Collecting psutil>=5
  Downloading psutil-5.8.0-cp39-cp39-manylinux2010_x86_64.whl (293 kB)
Collecting quandl
  Using cached Quandl-3.6.1-py2.py3-none-any.whl (26 kB)
Collecting sympy>=1.3
  Using cached sympy-1.8-py3-none-any.whl (6.1 MB)
Collecting websocket-client>=1.0.1
  Using cached websocket_client-1.2.1-py2.py3-none-any.whl (52 kB)
Collecting requests-ntlm>=1.1.0
  Using cached requests_ntlm-1.1.0-py2.py3-none-any.whl (5.7 kB)
Collecting urllib3>=1.21.1
  Downloading urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
Requirement already satisfied: python-dateutil>=2.8.0 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from qiskit-ibmq-provider==0.16.0->qiskit) (2.8.2)
Collecting requests>=2.19
  Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting fastjsonschema>=2.10
  Using cached fastjsonschema-2.15.1-py3-none-any.whl (21 kB)
Requirement already satisfied: dill>=0.3 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from qiskit-terra==0.18.3->qiskit) (0.3.4)
Collecting symengine>0.7; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "amd64" or platform_machine == "arm64"
  Downloading symengine-0.8.1-cp39-cp39-manylinux2010_x86_64.whl (38.3 MB)
Collecting jsonschema>=2.6
  Downloading jsonschema-4.0.1-py3-none-any.whl (69 kB)
Collecting ply>=3.10
  Using cached ply-3.11-py2.py3-none-any.whl (49 kB)
Collecting python-constraint>=1.4
  Using cached python-constraint-1.4.0.tar.bz2 (18 kB)
Collecting tweedledum<2.0,>=1.1
  Downloading tweedledum-1.1.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (930 kB)
Requirement already satisfied: six in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from docplex>=2.21.207->qiskit-aqua==0.9.5->qiskit) (1.16.0)
Collecting lxml>=4.5.1
  Downloading lxml-4.6.3-cp39-cp39-manylinux2014_x86_64.whl (6.9 MB)
Collecting multitasking>=0.0.7
  Using cached multitasking-0.0.9.tar.gz (8.1 kB)
Collecting pytz>=2017.3
  Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from scikit-learn>=0.20.0->qiskit-aqua==0.9.5->qiskit) (3.0.0)
Requirement already satisfied: joblib>=0.11 in /home/hectormenezes/.local/share/virtualenvs/UndergradProject-GDLVBQRN/lib/python3.9/site-packages (from scikit-learn>=0.20.0->qiskit-aqua==0.9.5->qiskit) (1.0.1)
Collecting more-itertools
  Downloading more_itertools-8.10.0-py3-none-any.whl (51 kB)
Collecting inflection>=0.3.1
  Using cached inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
Collecting mpmath>=0.19
  Using cached mpmath-1.2.1-py3-none-any.whl (532 kB)
Collecting cryptography>=1.3
  Downloading cryptography-35.0.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB)
Collecting ntlm-auth>=1.0.2
  Using cached ntlm_auth-1.5.0-py2.py3-none-any.whl (29 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting charset-normalizer~=2.0.0; python_version >= "3"
  Downloading charset_normalizer-2.0.6-py3-none-any.whl (37 kB)
Collecting idna<4,>=2.5; python_version >= "3"
  Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting attrs>=17.4.0
  Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading pyrsistent-0.18.0-cp39-cp39-manylinux1_x86_64.whl (117 kB)
Collecting cffi>=1.12
  Using cached cffi-1.14.6-cp39-cp39-manylinux1_x86_64.whl (405 kB)
Collecting pycparser
  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
Building wheels for collected packages: qiskit, docplex, yfinance, fastdtw, dlx, python-constraint, multitasking
  Building wheel for qiskit (setup.py): started
  Building wheel for qiskit (setup.py): finished with status 'done'
  Created wheel for qiskit: filename=qiskit-0.30.1-py3-none-any.whl size=11681 sha256=df13eca29f29e272db39cf081a7d90af6882d2d3198270560f860d6f534b3b1d
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/34/8b/a1/0a9c3920111456bd0e203e46102b44c7924cd8cd2fb1be95cd
  Building wheel for docplex (setup.py): started
  Building wheel for docplex (setup.py): finished with status 'done'
  Created wheel for docplex: filename=docplex-2.22.213-py3-none-any.whl size=696852 sha256=d3f2492f8ed54379da1d10bb5463253c4fbb4c74bf595cdb1380674e2cc8ae25
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/a6/54/b8/97d38dd12a97871952801b9c24480bf0701ab5034ea816d80b
  Building wheel for yfinance (setup.py): started
  Building wheel for yfinance (setup.py): finished with status 'done'
  Created wheel for yfinance: filename=yfinance-0.1.63-py2.py3-none-any.whl size=23910 sha256=fc5e7eaafcaad5810bc2fecffafde4c1e542deb4a0d1c52d5780fa6be3c87dff
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/44/19/52/4db92c8786b13e717b9664529da13bf8d7b74aff580ca64fc0
  Building wheel for fastdtw (setup.py): started
  Building wheel for fastdtw (setup.py): finished with status 'done'
  Created wheel for fastdtw: filename=fastdtw-0.3.4-py3-none-any.whl size=3589 sha256=2b0cf410d624a5b90ea364b6d83328434285624230f1708445157a5d08a3964b
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/1f/a1/63/bfd0fddb5bf0b59f564872e29272cee8a2de0cd745d88fede5
  Building wheel for dlx (setup.py): started
  Building wheel for dlx (setup.py): finished with status 'done'
  Created wheel for dlx: filename=dlx-1.0.4-py3-none-any.whl size=5709 sha256=49a1c630eb568ead508202352ab255de0781c7fc5030ede88bf468a83f24915f
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/81/bd/ba/2896ffc1856e28914fcbf4d0ded1bfbb5924dad98c80ba2d5c
  Building wheel for python-constraint (setup.py): started
  Building wheel for python-constraint (setup.py): finished with status 'done'
  Created wheel for python-constraint: filename=python_constraint-1.4.0-py2.py3-none-any.whl size=24080 sha256=e5e1697432a05c7696927f468a964d9816290cebe2a56a1726016522df46076d
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/51/36/1f/c2ccb8dc4eba38c5215636d4ae2c480b32069cab0376bcc1a4
  Building wheel for multitasking (setup.py): started
  Building wheel for multitasking (setup.py): finished with status 'done'
  Created wheel for multitasking: filename=multitasking-0.0.9-py3-none-any.whl size=8366 sha256=8c42ddb0658f9a4b45b7b4af7dd1359909b352cd9d2a61dade1be1942fa6e1d9
  Stored in directory: /home/hectormenezes/.cache/pip/wheels/1d/13/0b/0c32509050dcd9264e9a90b1d9d2dc9c6db9538db151ea7d26
Successfully built qiskit docplex yfinance fastdtw dlx python-constraint multitasking
Installing collected packages: pybind11, fastjsonschema, symengine, attrs, pyrsistent, jsonschema, retworkx, psutil, ply, python-constraint, tweedledum, mpmath, sympy, qiskit-terra, qiskit-aer, docplex, lxml, multitasking, pytz, pandas, certifi, charset-normalizer, urllib3, idna, requests, yfinance, fastdtw, qiskit-ignis, dlx, h5py, more-itertools, inflection, quandl, qiskit-aqua, websocket-client, pycparser, cffi, cryptography, ntlm-auth, requests-ntlm, qiskit-ibmq-provider, qiskit
Successfully installed attrs-21.2.0 certifi-2021.5.30 cffi-1.14.6 charset-normalizer-2.0.6 cryptography-35.0.0 dlx-1.0.4 docplex-2.22.213 fastdtw-0.3.4 fastjsonschema-2.15.1 h5py-3.2.1 idna-3.2 inflection-0.5.1 jsonschema-4.0.1 lxml-4.6.3 more-itertools-8.10.0 mpmath-1.2.1 multitasking-0.0.9 ntlm-auth-1.5.0 pandas-1.3.3 ply-3.11 psutil-5.8.0 pybind11-2.8.0 pycparser-2.20 pyrsistent-0.18.0 python-constraint-1.4.0 pytz-2021.3 qiskit-0.30.1 qiskit-aer-0.9.0 qiskit-aqua-0.9.5 qiskit-ibmq-provider-0.16.0 qiskit-ignis-0.6.0 qiskit-terra-0.18.3 quandl-3.6.1 requests-2.26.0 requests-ntlm-1.1.0 retworkx-0.10.2 symengine-0.8.1 sympy-1.8 tweedledum-1.1.1 urllib3-1.26.7 websocket-client-1.2.1 yfinance-0.1.63

Adding qiskit to Pipfile's [packages]…
Pipfile.lock (65c7b3) out of date, updating to (18bcdb)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
lf.repository.get_dependencies(ireq)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 174, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 222, in get_legacy_dependencies
    result = reqset._prepare_file(self.finder, ireq, ignore_requires_python=True)
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_set.py", line 644, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_install.py", line 434, in run_egg_info
    call_subprocess(
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/utils/__init__.py", line 705, in call_subprocess
    raise InstallationError(
pip9.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpg2ql_plzbuild/qiskit-terra/

Steps to reproduce the problem

Install qiskit with a pipenv virtualenv.

What is the expected behavior?

Qiskit is supposed to be installed successfully.

Suggested solutions

I don't have any idea, I don't even know for sure if that's an error of caused by Qiskit directly. However, I've been trying all solutions related to pip9.exceptions.InstallationError I've found, and all libraries and frameworks work well in my personal and work computer (I used to use Pop!_OS, but installed Ubuntu 21.04 in my PC) when using pipenv.

jakelishman commented 3 years ago

This doesn't appear to be directly caused by Qiskit - your pip reports that it installed correctly:

Successfully installed attrs-21.2.0 [...] qiskit-0.30.1 qiskit-aer-0.9.0 qiskit-aqua-0.9.5 qiskit-ibmq-provider-0.16.0 qiskit-ignis-0.6.0 qiskit-terra-0.18.3 [...]

Something looks funny in your error, message, though - it alludes to pip9, whereas pip 10.0 was released in 2018, and pip9 stopped being vendored by pipenv in May 2018. What's your version of pipenv, and can you update it?

HectorMenezes commented 3 years ago

I thought this pip9 was kind of strange too, I've never used this version before, and it only appears when installing Qiskit. The current version:

$ pipenv --version
pipenv, version 11.9.0
jakelishman commented 3 years ago

Yeah, that version is from March 2018. Looking at your error log, you've got pipenv installed through your system package manager (apt or apt-get). Unfortunately, that's the latest version in Ubuntu's repos - is there any chance you can install a slightly less ancient version through the system pip instead? It's a pure-Python package, so there shouldn't be any benefit to using the system package manager for it.

For the record, I was able to install qiskit fine with the most recent pipenv==2021.5.29.