无法在Fedora上安装QISKIT

时间:2018-12-04 12:08:01

标签: python gcc fedora psutil qiskit

我试图在我的Fedora 28系统上的Python3上安装QISKIT(按照其website上的说明),但是抛出了以下错误。我试图找到一种解决方案,并尝试了人们提出的here所建议的一切。但是问题仍然存在。

pip3 install qiskit --user    
Collecting qiskit
  Using cached https://files.pythonhosted.org/packages/b0/83/5aee99f9e958700ca1c4af2c5509b9bf0f012796d4aca5df680e6e7e827c/qiskit-0.6.1-cp36-cp36m-manylinux1_x86_64.whl
Requirement already satisfied: networkx>=2.0 in /usr/local/lib/python3.6/site-packages (from qiskit)
Requirement already satisfied: IBMQuantumExperience>=2.0.3 in /root/.local/lib/python3.6/site-packages (from qiskit)
Requirement already satisfied: pillow>=4.2.1 in /usr/lib64/python3.6/site-packages (from qiskit)

。 。 。

  running build_ext
  building 'psutil._psutil_linux' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psutil
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=548 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
  psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
   #include <Python.h>
            ^~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for psutil
  Running setup.py clean for psutil

。 。 。

    psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-euta5w0j/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-49bs3guc-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-euta5w0j/psutil/

关于应该怎么做的任何建议?由于Stackoverflow编辑器不允许,因此无法在此处张贴完整的错误跟踪。

1 个答案:

答案 0 :(得分:1)

看着QISKIT的github仓库,我发现其他人也有类似的问题。首先查看此处https://github.com/Qiskit/qiskit-tutorial/issues/254处的响应。他们建议您安装psutil。我将从这个https://github.com/giampaolo/psutil/blob/master/INSTALL.rst开始。另外,就其价值而言,我看到github上的海报也使用了Fedora。