LINK : fatal error LNK1158: cannot run 'rc.exe' (无法运行rc.exe)解决方案

问题

python 用pip安装scrapy的时候遇到了如下问题

LINK : fatal error LNK1158: cannot run 'rc.exe'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1158
ERROR: Command "'c:\users\dell\appdata\local\programs\python\python37\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\DELL\\AppData\\Local\\Temp\\pip-install-5wrv8_f_\\twisted\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\DELL\AppData\Local\Temp\pip-record-qa79bo2e\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\DELL\AppData\Local\Temp\pip-install-5wrv8_f_\twisted\
----------------------------------------

大概是rc.exe出了问题,因为之前不小心删除了Microsoft Visusal Studio的一些文件

解决方案

添加环境变量 ,在环境变量path中添加C:\Program Files (x86)\Windows Kits\8.1\bin\x86

rc.exercdll.dll

C:\Program Files (x86)\Windows Kits\8.1\bin\x86

拷贝到

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

成功安装
重新执行pip install scrapy ,安装成功,问题解决

你可能感兴趣的:(LINK : fatal error LNK1158: cannot run 'rc.exe' (无法运行rc.exe)解决方案)