3
$\begingroup$

I tried to follow the web instructions to load Qiskit, including VC++ 2017 Redistributable, but I get many errors upon installation. The gist seems to be that VC++ 2017 wasn't found. Some results coped below - any suggestions?

=========================================================
.
.
.
  Building wheel for qiskit-aer (setup.py) ... error
  ERROR: Command errored out with exit status 1:
.
.
.
.
  --------------------------------------------------------------------------------
  -- Trying "Ninja (Visual Studio 15 2017 Win64 v141)" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
.
.
.
.
  ----------------------------------------
  ERROR: Failed building wheel for qiskit-aer
  Running setup.py clean for qiskit-aer
  Building wheel for qiskit-terra (setup.py) ... error
  ERROR: Command errored out with exit status 1:
.
.
.
.
    scikit-build could not get a working generator for your system. Aborting build.

Building windows wheels for Python 3.8 requires Microsoft Visual Studio 2017.
Get it with "Visual Studio 2017":

  https://visualstudio.microsoft.com/vs/
$\endgroup$
9
  • 2
    $\begingroup$ Hi @Dave! Could you provide more details, like the link of the webpage you're following, OS, and full log? Thanks! $\endgroup$
    – C. Kang
    Commented Nov 28, 2019 at 0:02
  • $\begingroup$ Hi C.! Thanks for your reply. I was following the directions at qiskit.org/documentation/install.html, I am using Windows10. I'd like to attach my log but can't see how to do that; if you give me an email, I'll send it. $\endgroup$
    – DaveRDen
    Commented Nov 28, 2019 at 20:02
  • $\begingroup$ Is there any way to send or post a full log of the problem (74000 characters)? $\endgroup$
    – DaveRDen
    Commented Dec 2, 2019 at 20:40
  • $\begingroup$ Sorry for the late reply! I'd recommend posting the log to pastebin then sharing the link. What step in installation does it fail? $\endgroup$
    – C. Kang
    Commented Dec 3, 2019 at 1:32
  • $\begingroup$ thanks for the reply! I have put the log at pastebin.com/ys0c3DY3, the first error reads, Building wheel for qiskit-aer (setup.py) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\DaveR\AppData\Local\conda\conda\envs\Env2_for_QISkit\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\DaveR\\AppData\\Local\\Temp\\pip-install-1oanpuze\\qiskit- $\endgroup$
    – DaveRDen
    Commented Dec 4, 2019 at 17:52

2 Answers 2

2
$\begingroup$

You are probably using Python 3.8. Qiskit only works with Python 3.5, 3.6 and 3.7 - see here for details

In most cases using Python 3.7 is enough, but if you get another error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType you can try the below part.

After downgrading to Python 3.7.3 and pip 19.1.1 it still gave an error - it could not resolve a path to VC++ 2017 Redistributable for fastdtw.

For me it worked to hack it like this:

  1. Find where you have instaleed vcruntime140.dll. I found a copy in %USERPROFILE%\Anaconda3\envs\<<environment_name>>\vcruntime140.dll
  2. Open the file %USERPROFILE%\Anaconda3\envs\<<environment_name>>\Lib\site-packages\setuptools\msvc.py
  3. Edit the function def VCRuntimeRedist(self) to return the path to vcruntime140.dll (don't forget to escape the \s)
  4. run pip install qiskit
$\endgroup$
2
  • $\begingroup$ That first part was important, I replaced Python 3.8 with Python 3.7 within Anaconda Navigator, ran reran the VC++ 2017 Redistributable, then the new install went smoothly. Didn't seem to be a need for the second hack - thanks! $\endgroup$
    – DaveRDen
    Commented Dec 17, 2019 at 22:56
  • $\begingroup$ @DaveRDen - approve Sorin's answer! $\endgroup$
    – C. Kang
    Commented Feb 4, 2020 at 21:59
-1
$\begingroup$

Do install Microsoft Visual C++ . So tat the error can be satisfied. And also do pip install wheel.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.