1

I have been trying to install cvxpy an several windows machines (Win 7 and 10) with Anaconda without success. I foolowed the instructions (https://www.cvxpy.org/install/index.html) and also installed the recommended build tools. However, pip doesn't seem to find them. Strange thing is: Half a year ago, I did the same thing with own PC and it was absolutely painless. I noticed that on the machines a have problems with, Anaconda is installed for All Users, while on my machine it's only for me as user. So I installed the VCForPython27.msi with the ALLUSERS=1 option, but still, cvxpy doesn't want to be installed. I couldn't find anything on the web. Everybody recommends to install the build tools, but they are installed!

Thank you for any help!

The error report is very big, so include only a few things:

  ERROR: Complete output from command 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\coach\\AppData\\Local\\Temp\\pip-install-osf22hmo\\cvxpy\\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\coach\AppData\Local\Temp\pip-wheel-agyr6v1n' --python-tag cp37:
  ERROR: running bdist_wheel
...
  running build_ext
  building '_cvxcore' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
  ----------------------------------------
  ERROR: Failed building wheel for cvxpy
´´´

1 Answers1

1

Got it, after hours of trying! I downloaded the newest build tools from https://visualstudio.microsoft.com/de/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16&rr=https%3A%2F%2Fwww.cvxpy.org%2Finstall%2Findex.html When running, a graphical menu appers and I manually checked build tools in the upper left corner. In addition, I checked C++/CLI support in the details section. After rebooting, I could run pip install cvxpy without errors.

This thread was really helpful (although the layout of the GUI has changed): Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

  • Thanks for posting your solution! – Akshay Agrawal Oct 06 '19 at 20:33
  • I am having a similar problem. My error said I need C++ 14.0, but I heard somewhere that I need the same version of C++ that my python was compiled with. Does the version of C++ match the version you downloaded from build tools? – wjamdanf1234 Mar 08 '20 at 10:04