Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Visual C++ 14.0 is required - error - pip install fbprophet

I am trying pip install fbprophet. I am getting that error: "Microsoft Visual C++ 14.0 is required" It has been discussed many times (e.g. Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) ) , but seems no answer helps me.

My environment:

Windows 7

Anaconda - just installed

Mirosoft VC 2017 - just installed ( It is not version 14, but it is newer - it seems impossible to load 14 (2015) version from MS site )

MS VC Build Tools - also just installed

computer has been relauched after installations

like image 263
Alexander Chervov Avatar asked Jul 21 '18 21:07

Alexander Chervov


People also ask

How do I fix Microsoft Visual C++ 14 0 is required?

Sometimes, the “error: Microsoft Visual C++ 14.0 is required” can occur due to the Visual Studio installer getting corrupted or outdated. In this case, you can try using the latest Microsoft Visual Studio installer. Some users reported that the error can be fixed by installing Visual Studio 2019.

Is Microsoft Visual C++ 14 required to install Python?

According to user reports in forums and communities, we find the “error: Microsoft Visual C++ 14.0 is required.” Often occurs while installing Python. Here is a true example from answer.microsoft.com:

Why can’t I install Microsoft Visual C++ 2015?

As hinted by the error message, the main reason is often related to the Microsoft Visual C++ Build Tools. Sometimes, the corrupted installation of the Visual C++ Build Tools and outdated Visual Studio installer can trigger the error. Can’t Install Microsoft Visual C++ 2015? – Here Are 6 Fixes

How do I upgrade Pip to the latest version?

Upgrade pip with command python -m pip install --upgrade pip Run your command python -m pip install twint to install the package There are literally hundreds of options in the download you linked. It makes an answer with the link, but no info what to select, anything but helpful. Close the terminal and try installing the package again.


3 Answers

I had the same problem but I solved using these instructions: https://facebook.github.io/prophet/docs/installation.html

From that page, you can go to the installation instructions for PyStan (which is needed) in which is specified how to install a C++ compiler for the libraries.

tl;dr -> conda install libpython m2w64-toolchain -c msys2

It does not install MS compiler, but it worked on my case and I had also errors regarding the compiler (also had VS2017 installed). I run Windows 10 and latest Anaconda distribution. I hope it helps.

like image 167
VictorHMartin Avatar answered Oct 16 '22 17:10

VictorHMartin


I could not solve it in the latest version of Anaconda which is 5.3.0. Upon extensive googling, I found a thread on github that advised me to go back to the previous version of Anaconda which is 5.2.0.

With that, it worked fine.

Thanks for taking time to look into it though.

like image 23
Bharat Avatar answered Oct 16 '22 17:10

Bharat


VictorHMartin's answer (and following the details from the links provided) worked perfectly fine for me as long as I tried using them with Python 3.7. However, I needed to get them working with Python 3.9, where the last two conda commands failed and I had to use pip instead; here's the list of commands that worked for me:

  • conda create -n venv (replace venv name as you like)
  • activate venv
  • conda install libpython m2w64-toolchain -c msys2
  • conda install numpy pandas cython -c conda-forge
  • conda install matplotlib scipy plotly -c conda-forge (fbprophet optionally needs plotly for interactive plots)
  • pip install pystan (conda install pystan -c conda-forge failed here for P3.9)
  • pip install fbprophet (conda install fbprophet -c conda-forge failed here for P3.9)
like image 4
ezadeh Avatar answered Oct 16 '22 18:10

ezadeh