我正在尝试使用instructions here (选择"Install from source“选项卡)从源安装Qiskit。我正在64位Ubuntu 20.04 LTS上安装,并且刚刚更新了所有的包。
我得到了下面显示的错误,这可能与CMake或忍者有关。忍者已安装,但当我运行忍者时,我收到以下消息:
> ninja
ninja: error: loading 'build.ninja': No such file or directory我不确定这是否相关。
有人知道问题出在哪里吗?
> pip install -e .
Obtaining file:///home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Requirement already satisfied: pybind11>=2.6 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-aer==0.9.0) (2.6.2)
Requirement already satisfied: qiskit-terra>=0.17.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-terra (from qiskit-aer=>
Requirement already satisfied: numpy>=1.16.3 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-aer==0.9.0) (1.20.1)
Requirement already satisfied: scipy>=1.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-aer==0.9.0) (1.6.1)
Requirement already satisfied: jsonschema>=2.6 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit->
Requirement already satisfied: retworkx>=0.9.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit->
Requirement already satisfied: ply>=3.10 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit-aer==0>
Requirement already satisfied: psutil>=5 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit-aer==0>
Requirement already satisfied: sympy>=1.3 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit-aer==>
Requirement already satisfied: dill>=0.3 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit-aer==0>
Requirement already satisfied: fastjsonschema>=2.10 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qi>
Requirement already satisfied: python-constraint>=1.4 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->>
Requirement already satisfied: python-dateutil>=2.8.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->>
Requirement already satisfied: symengine>0.7 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from qiskit-terra>=0.17.0->qiskit-ae>
Requirement already satisfied: attrs>=17.4.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from jsonschema>=2.6->qiskit-terra>=>
Requirement already satisfied: setuptools in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from jsonschema>=2.6->qiskit-terra>=0.1>
Requirement already satisfied: six>=1.11.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from jsonschema>=2.6->qiskit-terra>=0.>
Requirement already satisfied: pyrsistent>=0.14.0 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from jsonschema>=2.6->qiskit-te>
Requirement already satisfied: mpmath>=0.19 in /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages (from sympy>=1.3->qiskit-terra>=0.17.0>
Installing collected packages: qiskit-aer
Attempting uninstall: qiskit-aer
Found existing installation: qiskit-aer 0.9.0
Uninstalling qiskit-aer-0.9.0:
Successfully uninstalled qiskit-aer-0.9.0
Running setup.py develop for qiskit-aer
ERROR: Command errored out with exit status 1:
command: /home/john/anaconda3/envs/QiskitDevenv/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/john/anaconda3>
cwd: /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer/
Complete output (77 lines):
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is GNU 9.3.0
-- 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
-- The CXX compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer/_cmake_test_compile/build
CMake Error at CMakeLists.txt:15 (project):
Running
'/tmp/pip-build-env-v00vgfai/overlay/bin/ninja' '--version'
failed with:
No such file or directory
-- Configuring incomplete, errors occurred!
See also "/home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer/_skbuild/linux-x86_64-3.9/cmake-build/CMakeFiles/CMakeOutput>
File "/tmp/pip-build-env-nhehkrf9/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 582, in setup
env = cmkr.configure(cmake_args,
File "/tmp/pip-build-env-nhehkrf9/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 229, in configure
raise SKBuildError(
An error occurred while configuring with CMake.
Command:
/tmp/pip-build-env-nhehkrf9/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-p>
Source directory:
/home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer
Working directory:
/home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer/_skbuild/linux-x86_64-3.9/cmake-build
Please see CMake's output for more information.
--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - success
--------------------------------------------------------------------------------
Configuring Project
Working directory:
/home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer/_skbuild/linux-x86_64-3.9/cmake-build
Command:
/tmp/pip-build-env-nhehkrf9/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-p>
Traceback (most recent call last):
----------------------------------------
Rolling back uninstall of qiskit-aer
Moving to /home/john/anaconda3/envs/QiskitDevenv/lib/python3.9/site-packages/qiskit-aer.egg-link
from /tmp/pip-uninstall-vno4ffn6/qiskit-aer.egg-link
ERROR: Command errored out with exit status 1: /home/john/anaconda3/envs/QiskitDevenv/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.ar>发布于 2021-06-09 17:32:28
由于文件build.niinja不存在,所以出现错误消息ninja: error: loading 'build.ninja': No such file or directory是不相关的。在构建(运行setup.py) Aer包时,pb是一个相当大的错误。
https://stackoverflow.com/questions/67896502
复制相似问题