1

I'm trying to get PIP to install Twisted but I'm getting this LINK error.
I'm using 64 bit Windows 8 with python 2.7.10. I think this issue is related to the Visual Studio compiler. I've got 2009 and 2010, but I'm not sure which one it's using. I've already looked through a ton of stackoverflow posts concerning this issue and Visual Studio.. but none has really helped me. I've tried stuff from:

Cannot find vcvarsall.bat when running a Python script

Errors while building/installing C module for Python 2.7

I was actually having this problem with cffi and cryptography as well, but I used wheel and through that, installed those package's wheel files. It's a workaround... but for Twisted 10.0.0 there is no wheel file so I can't get around it.

Here's the last bit of messages before it poops it.

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
Community
  • 1
  • 1
pyramidface
  • 1,207
  • 2
  • 17
  • 39

2 Answers2

0

Try to install C compiler https://www.microsoft.com/en-us/download/details.aspx?id=44266. You may need to install yet Cython.

Sergey Nosov
  • 350
  • 3
  • 10
  • Do you know how I may be able to ensure that Python is using this compiler? I think I've installed this before but Python is still using my old Visual Studio to compile? – pyramidface Jun 22 '15 at 23:32
0

You can install MinGW.

  1. You need a MinGW installation.
  2. Add variable PATH, a path to MinGW
  3. In C:\Python27\Lib\distutils create a empty distutils.cfg file.

In the file type:

[build] compiler=mingw32

Sergey Nosov
  • 350
  • 3
  • 10