Do I really need Microsoft Visual Studio C++ 14.0 to run AMPL with Python?

After installing AMPL using the .exe file, I tried following the instructions to run AMPL and the solvers as variables in Python. The first line of code I ran was

python -m pip install amplpy --upgrade

Here’s the error message I received

error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: Microsoft C++ Build Tools - Visual Studio

The thing is, I downloaded the C++ Build Tools and restarted my laptop. When I re-ran the line, I got the same error.

Do I need to download Microsoft Visual Studio to use as the IDE for AMPL with Python?

The goal is to run AMPL in Spyder or VSCode, not Microsoft VS. Having to use the VisualStudio IDE would be overkill. If you have faced this problem before, please let me know if you found a solution.

Thank you.

Hi @Hugo,

Thank you for reaching out. You just need to have the Microsoft Visual C++ Redistributable Package installed (Introduction — AMPL API 2.1 (amplpy-0.14.0) documentation). You can download it from https://aka.ms/vs/16/release/vc_redist.x64.exe.