1

I am trying to use gaft package in pycharm but I got this error:

running build_clib MPI configuration: [msmpi] from 'C:\Program Files (x86)\Microsoft SDKs\MPI' error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

the problem is that I installed Microsoft Visual C++ but I still got that error.

spranza
  • 11
  • 1
  • 5
  • 1
    Did you reboot your PC or at least re-open the console? Also when you say `I installed Microsoft Visual C++`, please be more specific, there's a lot of things that go by that name. Which version and which software specifically did you install? – PeterT Jul 18 '18 at 08:39

2 Answers2

0

This error happens when Python cannot properly run the C compiler while installing a package. If you properly installed VC++ (i.e. restart and all) it should be ok.

Alternatively, you could use MinGW as the C compiler.

Amnon
  • 2,212
  • 1
  • 19
  • 35
  • Would that mean that PyCharm supports MinGW as C/C++ compiler for Python packages that are written on Visual C++ C compiler? Because that is quite unclear at least for vscode, which should be the same issue, see https://github.com/microsoft/vscode-cpptools/issues/5695, please tell if you have tested this. – questionto42 Jun 28 '20 at 12:13
  • 1
    I don't think it is pycharm (or any IDE in general) that should support any of the c-compiler. The c-compiler is used by the python package installation process to compile any package whose installation process requires it. – Amnon Jun 28 '20 at 12:56
  • Then it would be interesting to know how I could use MinGW c compiler for e.g. dtaidistance package which asks me to have Visual C++ installed and thus searches for cl.exe. How could I make that work with MinGW gcc.exe? – questionto42 Jun 28 '20 at 16:49
  • 1
    You can see the instructions for mingw as wlel as other compilers in: https://wiki.python.org/moin/WindowsCompilers#GCC_-_MinGW-w64_.28x86.2C_x64.29 – Amnon Jun 28 '20 at 18:26
  • That covers only MinGW as C++ for Python up to 3.4, not the recent Python versions. That is probably not relevant for the majority, and still this brings up the idea to demand the "distutils.cfg" workaround also for the recent Python versions. – questionto42 Jun 28 '20 at 18:45
  • so use the microsoft compiler. Download location i in the python docs. – Amnon Jun 30 '20 at 05:43
  • The same was said on https://github.com/microsoft/vscode-cpptools/issues/5695, there is simply no MinGW solution for recent Python versions at the moment. – questionto42 Jun 30 '20 at 07:08
  • I guess that is true. What is the problem you are trying to solve? Installing a Python package or getting MinGW for recent Python versions? – Amnon Jun 30 '20 at 09:57
  • I try to save 4 GB disk space using MinGW instead of MSVC (or reduce the 4.5 GB MSVC size to the 0.5 of MinGW somehow). It is the issue of https://github.com/microsoft/vscode-cpptools/issues/5695 which was first started on https://stackoverflow.com/questions/62149329/imitate-visual-c-with-mingw-or-other-c-compilers-for-python-packages-based. I guess it could be solved, it just does not have priority. – questionto42 Jun 30 '20 at 11:16
0

The following Download link for VC++ takes just a few MB and can help you save a lot of space. This installation lets you work with pip without any errors.

Download VC++ 14.0 for Windows

After Installation, pip works like a charm.

Edit: Attaching the origin of the file. Techspot Link