Python,安装 clarifai --> VS14.0 link.exe 失败,退出状态为 1158

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43858836/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 23:27:13  来源:igfitidea点击:

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

pythonvisual-c++command-lineclarifai

提问by Sundancer

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

我已经全新安装了 Python 3.6 + Selenium,现在想安装 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.

起初它要求 VC++ 14.0,但我有 14.1(使用 VS2017),所以我安装了 VC++2015 BuildTools,它有 14.0。这在创建库之前部分起作用。

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.0\VC\BIN\link.exe' failed with exit status 1158

生成代码
完成生成代码
链接:致命错误 LNK1158:无法运行 'rc.exe' 错误:命令 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe' failed with exit status 1158

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

不知道我的安装中是否缺少某些东西?谢谢你

回答by joe

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

我今天遇到了类似的问题,我参考解决了

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

由于 rc.exe ,Visual Studio 无法构建

To fix the issue, do next steps:

要解决此问题,请执行以下步骤:

  1. Add this to your PATHenvironment variables:

    C:\Program Files (x86)\Windows Kits\10\bin\x64

  2. Copy these files rc.exe& rcdll.dllfrom C:\Program Files (x86)\Windows Kits\8.1\bin\x86to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

  1. 将此添加到您的PATH环境变量中:

    C:\Program Files (x86)\Windows Kits\10\bin\x64

  2. 将这些文件复制rc.exercdll.dllC:\Program Files (x86)\Windows Kits\8.1\bin\x86C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

In newer Windows these files might also be in the highest version: C:\Program Files (x86)\Windows Kits\10\bin\10.0.VERSION\x86

在较新的 Windows 中,这些文件也可能是最高版本: C:\Program Files (x86)\Windows Kits\10\bin\10.0.VERSION\x86

回答by Ric Hard

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

我在使用PIP/Python 3.5Visual Studio 2017时遇到了同样的问题,同时使用pip安装 librosa (并且它的依赖关系重采样)

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

使用Visual Studio 2017 开发人员提示并从那里运行 pip install解决了该问题。

Hope that helps someone.

希望能帮助某人。

回答by John Jefferies

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 Kits\10\bin\10.0.16299.0\x64". The solution is similar to another answer. It is to either copy or take a symlink of rc.exe and rcdll.dll from:

万一这对某人有帮助。使用基线 VS2015 时,我没有出现最初的问题。我现在看到与 LNK1158 错误相同的问题。我猜测是因为我现在使用的是 VS2015 Update 2,它使用来自“C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64”的 rc.exe。该解决方案类似于另一个答案。它是从以下位置复制或获取 rc.exe 和 rcdll.dll 的符号链接:

    C:\Program Files (x86)\Windows Kits\bin.0.16299.0\x64

to

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64