Skip to content

Commit

Permalink
Fix numpy not found issue when installing (Qiskit#1056)
Browse files Browse the repository at this point in the history
When doing python ./setup.py install in a clean env, CMake is unable to
find numpy. Here we force the installation of numpy if it is not
installed before CMake is called.

Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
  • Loading branch information
vvilpas and chriseclectic committed Jan 25, 2021
1 parent 432a35e commit d516e23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "urllib3<1.26", "conan>=1.22.2", "scikit-build", "cmake!=3.17.1,!=3.17.0", "ninja", "pybind11>2.4", "Cython>0.27.1"]
requires = ["setuptools", "wheel", "urllib3<1.26", "conan>=1.22.2", "scikit-build",
"cmake!=3.17.1,!=3.17.0", "ninja", "pybind11>2.4", "numpy>1.16.3"]
1 change: 1 addition & 0 deletions qiskit/providers/aer/library/save_amplitudes2 copy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
conditional=False):
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
except ImportError:
subprocess.call([sys.executable, '-m', 'pip', 'install', 'pybind11>=2.4'])

try:
from numpy import array
except ImportError:
subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy>=1.16.3'])

from skbuild import setup


Expand Down

0 comments on commit d516e23

Please sign in to comment.