question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot locate suitable C compiler VS2019

See original GitHub issue

Hello, this is regarding nuitka version 0.6.7 obtained via pip on Windows Server 2019.

The precise error can be found in this pipeline output:

scons: warning: MSVC_USE_SCRIPT set to False, assuming environment set correctly.
File "C:\HOSTED~1\windows\Python\3794D4~1.7\x64\lib\SITE-P~1\nuitka\build\SINGLE~1.SCO", line 521, in createEnvironment
Error, cannot locate suitable C compiler. You have the following options:

a) If a suitable Visual Studio version is installed, it will not be located
   automatically, unless you install pywin32 for the Python installation
   below "C:\hostedtoolcache\windows\Python\3.7.7\x64".

b) To make it find Visual Studio without registry execute from Start Menu
   the 'Visual Studio Command Prompt' or "vcvarsall.bat". That will add
   Visual Studio to the "PATH". And it then will be detected.

c) Install MinGW64 to "C:\MinGW64" or "\MinGW", where then it is automatically
   detected or add it to PATH before executing Nuitka. But be sure to pick the
   proper variant (32/64 bits, your Python arch is 'x86_64'), or else cryptic errors
   will be shown.

The build machine has Visual Studio 2019 Enterprise installed, and as part of suggestion b) provided by the error, I run this command beforehand (but still encounter this error): C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat

Also tried pip install pywin32 beforehand to address suggestion a), but this also leads to same error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lxbrasscommented, May 11, 2020

This worked for me, one month ago (mid April 2020) using nuitka 0.6.7:

  1. Install Microsoft - Visual Studio Build Tools 2019, default options should be enough. I changed the install location. [image: image.png]

  2. Find vcvarsall.bat in your installation, I found it in F:\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build

  3. Choose your build target (x86 or x64) to match the Python version/platform of your project.

  4. Open a command environment there and execute vcvarsall.bat, with the proper arguments for your target, to set the environment variables.

  5. In the same command window navigate to the location of your Python project.

  6. Compile with Nuitka.

  7. If that works, add the call to vcvarsall.bat to your build scripts… or the build system complexity layer of your choice 😉

Cheers.

On Sun, May 10, 2020 at 7:27 PM Daniel Nowak notifications@github.com wrote:

Hello, this is regarding nuitka version 0.6.7 obtained via pip on Windows Server 2019.

The precise error can be found in this pipeline output https://github.com/Fuzzwah/race-info/runs/661598630?check_suite_focus=true#step:4:9 :

in createEnvironment Error, cannot locate suitable C compiler. You have the following options:

a) If a suitable Visual Studio version is installed, it will not be located automatically, unless you install pywin32 for the Python installation below “C:\hostedtoolcache\windows\Python\3.7.7\x64”.

b) To make it find Visual Studio without registry execute from Start Menu the ‘Visual Studio Command Prompt’ or “vcvarsall.bat”. That will add Visual Studio to the “PATH”. And it then will be detected.

c) Install MinGW64 to “C:\MinGW64” or “\MinGW”, where then it is automatically detected or add it to PATH before executing Nuitka. But be sure to pick the proper variant (32/64 bits, your Python arch is ‘x86_64’), or else cryptic errors will be shown.

The build machine has Visual Studio 2019 Enterprise https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md#visual-studio-2019-enterprise installed, and as part of suggestion b) provided by the error, I run this command beforehand (but still encounter this error): C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat

Also tried pip install pywin32 beforehand to address suggestion a), but this also leads to same error.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Nuitka/Nuitka/issues/703, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHCS3VNPAVQDWFYYP3JPBRDRQ4Z5PANCNFSM4M5OJOUQ .

0reactions
kayhayencommented, May 13, 2020

@lowlyocean I am switching to https, just did so for factory branch. I hated it for writing if I recall correctly, because it needs more than a simply ssh key, but I will sort that out I guess

Read more comments on GitHub >

github_iconTop Results From Across the Web

CMake does not find Visual C++ compiler - Stack Overflow
I went searching for cl.exe in the Visual Studio folder, C:\Program Files\Microsoft Visual Studio 14.0 , and could not find it. How do...
Read more >
Intel C++ Compiler 19.1 can't work after update visual ...
Intel C++ Compiler 19.1 can't work after update visual studio2019 v16.8.0 ... FindEntry(TKey key) 1>C:\Program Files (x86)\Microsoft Visual ...
Read more >
Install C and C++ support in Visual Studio - Microsoft Learn
Learn how to install Visual Studio with support for Microsoft C/C++ and related workloads.
Read more >
Compiling amalgamation with Visual Studio 2019 - SQLite Forum
I'm guessing that your VS2019 install is defective. Any C compiler that cannot find "stdlib.h" has issues. (8) By Bill ...
Read more >
Microsoft Visual Studio 2022 set up as default C and C++ ...
Visual C++ is already installed in my desktop but how can I integrate it to MATLAB in order to be the compiler in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found