Installation on windows fails

Issue #10 wontfix
Anonymous created an issue

Host: windows 7 64bit Python version: 3.4.1 32 bit wheezy.template version: 0.1.151

When installing either from pip3 or downloading the source with python3 setup.py install

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT: PyInit_init build\temp.win32-3.4\Release\src\wheezy\template__init.obj /O UT:build\lib.win32-3.4\wheezy\template__init.pyd /IMPLIB:build\temp.win32-3.4 \Release\src\wheezy\template__init.lib /MANIFESTFILE:build\temp.win32-3.4\Rel ease\src\wheezy\template__init.pyd.manifest

LINK : error LNK2001: unresolved external symbol PyInit_init

build\temp.win32-3.4\Release\src\wheezy\template__init__.lib : fatal error LNK1 120: 1 unresolved externals

error: command 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\ link.exe' failed with exit status 1120


Cleaning up...

Comments (14)

  1. Andriy Kornatskyy repo owner

    The issue is most likely related to Python3.4 and Visual Studio. I tried with clean Windows 7 and python3.4. I used the following commands:

    C:\Python34\Tools\Scripts\pyvenv.py env
    env\Scripts\easy_install.exe wheezy.template
    # or
    env\Scripts\pip.exe install wheezy.template
    
  2. Joshua Moore-Oliva

    I tracked it down to a cython issue. If cython is installed, it will attempt to use cython and the build will fail. If I modify the setup.py script to remove the cython option, the pure python install works just fine.

  3. Joshua Moore-Oliva

    I am using a 32bit install of Python 3.4.1 on a 64 bit machine, and I can compile other modules without setting that flag. I don't think that will help.

    I will try it on Monday just in case though, and post the entire output log.

    -DMS_WIN64 doesn't make any sense since I am trying to compile a 32 bit extension.

  4. Joshua Moore-Oliva

    Following is the complete output from building with Python34

    PS C:\tmp\wheezy.template-0.1.151> C:\Python34\python setup.py build
    running build
    running build_py
    creating build
    creating build\lib.win32-3.4
    creating build\lib.win32-3.4\wheezy
    copying src\wheezy\__init__.py -> build\lib.win32-3.4\wheezy
    creating build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\builder.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\comp.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\compiler.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\engine.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\lexer.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\loader.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\parser.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\preprocessor.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\utils.py -> build\lib.win32-3.4\wheezy\template
    copying src\wheezy\template\__init__.py -> build\lib.win32-3.4\wheezy\template
    creating build\lib.win32-3.4\wheezy\template\ext
    copying src\wheezy\template\ext\code.py -> build\lib.win32-3.4\wheezy\template\ext
    copying src\wheezy\template\ext\core.py -> build\lib.win32-3.4\wheezy\template\ext
    copying src\wheezy\template\ext\determined.py -> build\lib.win32-3.4\wheezy\template\ext
    copying src\wheezy\template\ext\__init__.py -> build\lib.win32-3.4\wheezy\template\ext
    running build_ext
    building 'wheezy.template.builder' extension
    creating build\temp.win32-3.4
    creating build\temp.win32-3.4\Release
    creating build\temp.win32-3.4\Release\src
    creating build\temp.win32-3.4\Release\src\wheezy
    creating build\temp.win32-3.4\Release\src\wheezy\template
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\builder.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\builder.
    obj
    builder.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_builder build\temp.win32-3.4\Release\src\wheezy\template\builder.obj /OUT
    :build\lib.win32-3.4\wheezy\template\builder.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\builder.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\builder.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\builder.lib and object build\temp.win32-3.4\Release\src\wheezy\template\builder.exp
    building 'wheezy.template.comp' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\comp.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\comp.obj
    comp.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_comp build\temp.win32-3.4\Release\src\wheezy\template\comp.obj /OUT:build
    \lib.win32-3.4\wheezy\template\comp.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\comp.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\comp.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\comp.lib and object build\temp.win32-3.4\Release\src\wheezy\template\comp.exp
    building 'wheezy.template.compiler' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\compiler.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\compile
    r.obj
    compiler.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_compiler build\temp.win32-3.4\Release\src\wheezy\template\compiler.obj /O
    UT:build\lib.win32-3.4\wheezy\template\compiler.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\compiler.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\compiler.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\compiler.lib and object build\temp.win32-3.4\Release\src\wheezy\template\compiler.exp
    building 'wheezy.template.engine' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\engine.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\engine.ob
    j
    engine.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_engine build\temp.win32-3.4\Release\src\wheezy\template\engine.obj /OUT:b
    uild\lib.win32-3.4\wheezy\template\engine.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\engine.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\engine.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\engine.lib and object build\temp.win32-3.4\Release\src\wheezy\template\engine.exp
    building 'wheezy.template.lexer' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\lexer.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\lexer.obj
    lexer.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_lexer build\temp.win32-3.4\Release\src\wheezy\template\lexer.obj /OUT:bui
    ld\lib.win32-3.4\wheezy\template\lexer.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\lexer.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\lexer.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\lexer.lib and object build\temp.win32-3.4\Release\src\wheezy\template\lexer.exp
    building 'wheezy.template.loader' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\loader.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\loader.ob
    j
    loader.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_loader build\temp.win32-3.4\Release\src\wheezy\template\loader.obj /OUT:b
    uild\lib.win32-3.4\wheezy\template\loader.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\loader.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\loader.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\loader.lib and object build\temp.win32-3.4\Release\src\wheezy\template\loader.exp
    building 'wheezy.template.parser' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\parser.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\parser.ob
    j
    parser.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_parser build\temp.win32-3.4\Release\src\wheezy\template\parser.obj /OUT:b
    uild\lib.win32-3.4\wheezy\template\parser.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\parser.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\parser.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\parser.lib and object build\temp.win32-3.4\Release\src\wheezy\template\parser.exp
    building 'wheezy.template.preprocessor' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\preprocessor.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\pre
    processor.obj
    preprocessor.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_preprocessor build\temp.win32-3.4\Release\src\wheezy\template\preprocesso
    r.obj /OUT:build\lib.win32-3.4\wheezy\template\preprocessor.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\preprocessor.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\preprocessor.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\preprocessor.lib and object build\temp.win32-3.4\Release\src\wheezy\template\preprocessor.exp
    building 'wheezy.template.utils' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\utils.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\utils.obj
    utils.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit_utils build\temp.win32-3.4\Release\src\wheezy\template\utils.obj /OUT:bui
    ld\lib.win32-3.4\wheezy\template\utils.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\utils.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\utils.pyd.manifest
       Creating library build\temp.win32-3.4\Release\src\wheezy\template\utils.lib and object build\temp.win32-3.4\Release\src\wheezy\template\utils.exp
    building 'wheezy.template.__init__' extension
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsrc\wheezy\template\__init__.c /Fobuild\temp.win32-3.4\Release\src\wheezy\template\__init_
    _.obj
    __init__.c
    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python34\libs /LIBPATH:C:\Python34\PCbuild /EXPORT:PyInit___init__ build\temp.win32-3.4\Release\src\wheezy\template\__init__.obj /O
    UT:build\lib.win32-3.4\wheezy\template\__init__.pyd /IMPLIB:build\temp.win32-3.4\Release\src\wheezy\template\__init__.lib /MANIFESTFILE:build\temp.win32-3.4\Release\src\wheezy\template\__init__.pyd.manifest
    LINK : error LNK2001: unresolved external symbol PyInit___init__
    build\temp.win32-3.4\Release\src\wheezy\template\__init__.lib : fatal error LNK1120: 1 unresolved externals
    error: command 'c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\link.exe' failed with exit status 1120
    
  5. Joshua Moore-Oliva

    I am not running 64 bit python. I am running 32bit python on a 64bit machine.

    C:\tmp\wheezy.template-0.1.151>C:\Python34\python
    Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In
    tel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
  6. sbehnel

    @Joshua Moore-Oliva: Could you please provide the complete output of the build (from the setup.py build command all the way to the error output), as well as the Cython version you are using?

    I agree that Cython should not be used for the build by default. If the distribution contains the generated .c sources, they should be used, unless rebuilding is explicitly requested.

  7. Log in to comment