Python, installing clarifai –> VS14.0 link.exe failed with exit status 1158

Question:

I’ve got a fresh installation of Python 3.6 + Selenium and now want to install Clarifai 2.0.21.

The following command is failing:

python -m pip install clarifai==2.0.21

At first it requested VC++ 14.0 but I had 14.1 (with VS2017),
so I installed VC++2015 BuildTools which has 14.0. This worked partly until creating the library.

I got the new error as next:

Generating code
Finished generating code
LINK : fatal error LNK1158: cannot run ‘rc.exe’
error: command ‘C:Program Files (x86)Microsoft Visual Studio 14.0VCBINlink.exe’ failed with exit status 1158

Any idea if there’s something missing in my installation?
Thank You

Asked By: Sundancer

||

Answers:

I had a similar problem today, and I solved it referring to

Visual Studio can't build due to rc.exe.

To fix the issue, do next steps:

  1. Add this to your PATH environment variables:

    C:Program Files (x86)Windows Kits10binx64

  2. Copy these files rc.exe & rcdll.dll from C:Program Files (x86)Windows Kits8.1binx86 to C:Program Files (x86)Microsoft Visual Studio 14.0VCbin

In newer Windows these files might also be in the highest version: C:Program Files (x86)Windows Kits10bin10.0.VERSIONx86

Answered By: joe

I had the very same problem when using PIP / Python 3.5 and Visual Studio 2017 while installing librosa using pip (and it’s dependency resampy)

Solved the problem using the Visual Studio 2017 Developer prompt and running pip install from there.

Hope that helps someone.

Answered By: Ric Hard

In case this helps someone. The original problem didn’t occur for me with a baseline VS2015. I now see the same problem with the LNK1158 error. I surmise because I’m now using VS2015 Update 2, which uses rc.exe from “C:Program Files (x86)Windows Kits10bin10.0.16299.0×64”.
The solution is similar to another answer. It is to either copy or take a symlink of rc.exe and rcdll.dll from:

    C:Program Files (x86)Windows Kits10bin10.0.16299.0x64

to

    C:Program Files (x86)Microsoft Visual Studio 14.0VCbinamd64
Answered By: John Jefferies