Python pip install with LINK : fatal error LNK1104

2019-06-07 16:18发布

Just installed Windows 7 Ultimate and Python on this computer within the last week. So everything is fresh. When I try to pip install something as simple as

pip install twisted

It goes through the process, then stalls out and complaints about:

 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools
\MSVC\14.13.26128\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL
 /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\python36\libs 
/LIBPATHc:\python36\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft
Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\lib\x64" "/LIBPATH:C:\Program Files((x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.13.26128\lib\x86" /EXPORT:PyIinit_raiser build\temp.win-amd64-3.6\Release
\src/twisted/test/raiser.obj /OUT:build\lib.win-amd64-3.6\twisted
\test\raiser.cp36-win_amd6.pyd /IMPLIB:build\temp.win0amd64-3.6\Release
\src/twisted/test\raiser.cp36-win_amd64.lib'

LINK: fatal error LNK1104: cannot open file 'kernel32.lib'

I've done a search. There are 17 kernel32.lib files in various folders on my drive that have been installed by all the programming suites etc I've installed.

I have been researching this and cannot find a solution that works.

Reinstalling VC++ 2017 doesn't work. Installing "Microsoft Windows SDK for Windows 7" doesn't work. I've tried adding "PATH"'s to direct the files to the kernel32.lib and that hasn't worked either.

When I open Visual Studio, go to Tools > Options > Projects and Solutions > VC++ Directories it states:

VC++ Directories editing in Tools > Options has been deprecated.

VC++ Directories are now available as a user property sheet that is added by
default to all projects.

But I'm just doing a pip install in Python, I'm not making a C++ program.

Is it possible Microsoft has basically disabled my ability to use these files from via a pip install?

How do I fix this so I can install my packages properly?

Edit: This question is different from this question as that question was for different versions of VS and the answers to that question did not work and or did not apply.

1条回答
我想做一个坏孩纸
2楼-- · 2019-06-07 17:02

It was helpful for me:

python -m pip install --upgrade pip setuptools wheel

查看更多
登录 后发表回答