安装可选包 qiskit-aqua[cvx] 时出错

安装可选包 qiskit-aqua[cvx] 时出错

我一直在尝试使用 qiskit SVM,它需要可选包 qiskit[cvx]。安装包时

pip install qiskit-aqua[cvx] 

我遇到以下错误

>  running build_ext   building '_cvxcore' extension   error: Microsoft
> Visual C++ 14.0 or greater is required. Get it with "Microsoft C++
> Build Tools":
> https://visualstudio.microsoft.com/visual-cpp-build-tools/  
> ----------------------------------------   ERROR: Failed building wheel for cvxpy   Building wheel for ecos (setup.py) ... error  
> ERROR: Command errored out with exit status 1:    command:
> 'E:\DevelopmentEnvironments\Anaconda3\envs\qiskit_env\python.exe' -u
> -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AMITAVA\\AppData\\Local\\Temp\\pip-install-mon8de59\\ecos_5ec689fff8044fcebbc759d1411788bb\\setup.py'"'"';
> __file__='"'"'C:\\Users\\AMITAVA\\AppData\\Local\\Temp\\pip-install-mon8de59\\ecos_5ec689fff8044fcebbc759d1411788bb\\setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d
> 'C:\Users\AMITAVA\AppData\Local\Temp\pip-wheel-gknwgiii'
>        cwd: C:\Users\AMITAVA\AppData\Local\Temp\pip-install-mon8de59\ecos_5ec689fff8044fcebbc759d1411788bb\

我的环境中已经有轮子了,如这里。我还安装了最新的 Ms Visual Studio Tools。

Python配置是Anaconda,python版本是3.8.3

答案1

您可以在这里找到问题的解决方案https://github.com/Qiskit/qiskit-aqua

我遇到了同样的问题,但我按照 github 页面上的指南修复了它。

试一试

相关内容