2015-06-21 80 views
1

我試圖讓PIP安裝Twisted但我得到了這個LINK錯誤。
我使用64位Windows 8與python 2.7.10。 我認爲這個問題與Visual Studio編譯器有關。我有2009年和2010年,但我不確定它使用哪一個。我已經瀏覽了大量關於這個問題和Visual Studio的stackoverflow帖子......但沒有人真的幫助過我。我試過的東西來自:使用PIP安裝Python包會導致LINK:致命錯誤LNK1104:無法打開文件'python27.lib'

Cannot find vcvarsall.bat when running a Python script

Errors while building/installing C module for Python 2.7

實際上,我是有這個問題與CFFI和密碼爲好,但我用車輪和通過,這些安裝包的輪子文件。這是一個解決方法...但是對於Twisted 10.0.0,沒有輪子文件,所以我無法繞過它。

這是消息發送前的最後一個消息。

reading manifest file 'Twisted.egg-info\SOURCES.txt' 

writing manifest file 'Twisted.egg-info\SOURCES.txt' 

creating build\lib.win-amd64-2.7\twisted\internet\iocpreactor\iocpsupport 

copying twisted\internet/iocpreactor/iocpsupport\iocpsupport.c -> build\lib.win-amd64-2.7\twisted\internet/iocpreactor/iocpsupport 

copying twisted\internet/iocpreactor/iocpsupport\winsock_pointers.c -> build\lib.win-amd64-2.7\twisted\internet/iocpreactor/iocpsupport 

copying twisted\python\sendmsg.c -> build\lib.win-amd64-2.7\twisted\python 

copying twisted\runner\portmap.c -> build\lib.win-amd64-2.7\twisted\runner 

copying twisted\test\raiser.c -> build\lib.win-amd64-2.7\twisted\test 

running build_ext 

C:\Users\Andrew\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\Andrew\.virtualenvs\adventure_time\include -IC:\Users\Andrew\.virtualenvs\adventure_time\PC /Tcconftest.c /Foconftest.obj 

conftest.c 

conftest.c(1) : fatal error C1083: Cannot open include file: 'rpc/rpc.h': No such file or directory 

building 'twisted.test.raiser' extension 

creating build\temp.win-amd64-2.7 

creating build\temp.win-amd64-2.7\Release 

creating build\temp.win-amd64-2.7\Release\twisted 

creating build\temp.win-amd64-2.7\Release\twisted\test 

C:\Users\Andrew\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -IC:\Users\Andrew\.virtualenvs\adventure_time\include -IC:\Users\Andrew\.virtualenvs\adventure_time\PC /Tctwisted/test/raiser.c /Fobuild\temp.win-amd64-2.7\Release\twisted/test/raiser.obj 

raiser.c 

C:\Users\Andrew\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Users\Andrew\.virtualenvs\adventure_time\libs /LIBPATH:C:\Users\Andrew\.virtualenvs\adventure_time\PCbuild\amd64 /EXPORT:initraiser build\temp.win-amd64-2.7\Release\twisted/test/raiser.obj /OUT:build\lib.win-amd64-2.7\twisted\test\raiser.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\twisted/test\raiser.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\twisted/test\raiser.pyd.manifest 

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

error: command 'C:\\Users\\Andrew\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\link.exe' failed with exit status 1104 

---------------------------------------- 

Cleaning up... 

    Removing temporary dir c:\users\andrew\appdata\local\temp\pip_build_Andrew... 
Command C:\Users\Andrew\.virtualenvs\adventure_time\Scripts\python.exe -c "import setuptools;__file__='c:\\users\\andrew\\appdata\\local\\temp\\pip_build_Andrew\\twisted\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\andrew\appdata\local\temp\pip-b8elqk-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\andrew\appdata\local\temp\pip_build_Andrew\twisted 

Exception information: 
Traceback (most recent call last): 
    File "C:\Users\Andrew\.virtualenvs\adventure_time\lib\site-packages\pip\basecommand.py", line 134, in main 
    status = self.run(options, args) 
    File "C:\Users\Andrew\.virtualenvs\adventure_time\lib\site-packages\pip\commands\install.py", line 241, in run 
    requirement_set.install(install_options, global_options, root=options.root_path) 
    File "C:\Users\Andrew\.virtualenvs\adventure_time\lib\site-packages\pip\req.py", line 1298, in install 
    requirement.install(install_options, global_options, *args, **kwargs) 
    File "C:\Users\Andrew\.virtualenvs\adventure_time\lib\site-packages\pip\req.py", line 625, in install 
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) 
    File "C:\Users\Andrew\.virtualenvs\adventure_time\lib\site-packages\pip\util.py", line 670, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
InstallationError: Command C:\Users\Andrew\.virtualenvs\adventure_time\Scripts\python.exe -c "import setuptools;__file__='c:\\users\\andrew\\appdata\\local\\temp\\pip_build_Andrew\\twisted\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\andrew\appdata\local\temp\pip-b8elqk-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\andrew\appdata\local\temp\pip_build_Andrew\twisted 

回答

0

您可以安裝MinGW。

  1. 您需要安裝MinGW。
  2. 添加變量PATH,MinGW的路徑
  3. 在C:\ Python27 \ Lib \ distutils中創建一個空的distutils.cfg文件。

在文件類型:

[建設] 編譯器= mingw32的

相關問題