windows 10 64 bit x86 errors during installation with python 2.7

Issue #1 resolved
Serag Hassouna
created an issue

I have Microsoft visual c++ 2008 redistributable x64 and x86 and Microsoft visual c++ compiler package for python 2.7.

And I went to install this toolkit to complete installing dependencies for sfepy package.

When I've opened command prompt inside the top level directory (after cloning) and hit ((python setup.py install --user)) I encountered the error ((Unable to find vcvarsall.bat)), which fortunately was solved by assigning the location of the file vcvarsall.bat to the file msvc9compiler.py in "query_vcvarsall" function to the variable vcvarsall. But another error arouse with the executable "C:\Users\<UserName>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe" (where <UserName> is generally for any user name),

It says (( build\temp.win-amd64-2.7\Release\igakit\igalib.o : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' error: Command "C:\Users\<UserName>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\mingw\lib\gcc\mingw32\5.3.0 /LIBPATH:c:\mingw\lib /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:C:\Python27\PC\VS9.0\amd64 /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:C:\Python27\PC\VS9.0\amd64 /EXPORT:initigalib build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalibmodule.obj build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\fortranobject.obj build\temp.win-amd64-2.7\Release\igakit\igalib.o build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib-f2pywrappers2.o /OUT:build\lib.win-amd64-2.7\igakit\igalib.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib.pyd.manifest" failed with exit status 1112 ))

Even I've set vcvarsall configuration to x86 but the same error still occurs.

Are there any suggestions to workaround this error? ..............

Side Note: If a wheel file that supports win_amd64 is released just like what can be found at Christoph Gohlke's unofficial binaries for python extensions it would be really great, provided that until now all packages I've got from there were installed successfully with no apparent error. .......

Many thanks and appreciation for your effort.

Comments (8)

  1. Serag Hassouna reporter

    I now have mingw-w64 installed, and when running the same line ((python setup.py install --user)) I get the following error

    (( igalibmodule.obj : warning LNK4197: export 'initigalib' specified multiple times; using first specification Creating library build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib.lib and object build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib.exp igalib.o : error LNK2019: unresolved external symbol _gfortran_internal_pack referenced in function bspline_MOD_removeknot igalib.o : error LNK2019: unresolved external symbol _gfortran_matmul_r8 referenced in function bspeval_MOD_interpolate igalib.o : error LNK2019: unresolved external symbol _gfortran_stop_string referenced in function __bsp_MOD_hessian3 build\lib.win-amd64-2.7\igakit\igalib.pyd : fatal error LNK1120: 3 unresolved externals error: Command "C:\Users\Dell\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\7.1.0 /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:C:\Python27\PC\VS9.0\amd64 /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:C:\Python27\PC\VS9.0\amd64 /EXPORT:initigalib build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalibmodule.obj build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\fortranobject.obj build\temp.win-amd64-2.7\Release\igakit\igalib.o build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib-f2pywrappers2.o /OUT:build\lib.win-amd64-2.7\igakit\igalib.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib.pyd.manifest" failed with exit status 1120 ))

  2. Lisandro Dalcin repo owner

    I'm not an expert on Windows, I've never built igakit on Windows. This error is most likely related to the linker invokation missing the -lgfortran flag. Also, I'm not sure you are really using MinGW for building.

    Please open setup.cfg with a text editor and add the following lines, then try again.

    [build]
    #debug = 0
    compiler = mingw32
    
    [build_ext]
    libraries = gfortran # or maybe libgfortran?
    
  3. Serag Hassouna reporter

    I added these lines as you said, and No Explicit error arouse, the following is the output in command prompt from the place of what I guess is around the previous error.

    building 'igakit.igalib' extension
    compiling C sources
    C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
    
    compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -Ibuild\src.win-amd64-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
    gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -Ibuild\src.win-amd64-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c build\src.win-amd64-2.7\fortranobject.c -o build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\fortranobject.o
    Found executable C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gcc.exe
    gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900 -Ibuild\src.win-amd64-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c build\src.win-amd64-2.7\igakit\igalibmodule.c -o build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalibmodule.o
    compiling Fortran 90 module sources
    Fortran f77 compiler: C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O0
    Fortran f90 compiler: C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -fno-second-underscore -O0
    Fortran fix compiler: C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O0
    compile options: '-Ibuild\src.win-amd64-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
    extra options: '-Jbuild\temp.win-amd64-2.7\Release\igakit -Ibuild\temp.win-amd64-2.7\Release\igakit'
    gfortran.exe:f90: igakit/igalib.f90
    compiling Fortran sources
    Fortran f77 compiler: C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -O0
    Fortran f90 compiler: C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -fno-second-underscore -O0
    Fortran fix compiler: C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -O0
    compile options: '-Ibuild\src.win-amd64-2.7 -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c'
    extra options: '-Jbuild\temp.win-amd64-2.7\Release\igakit -Ibuild\temp.win-amd64-2.7\Release\igakit'
    gfortran.exe:f90: build\src.win-amd64-2.7\igakit\igalib-f2pywrappers2.f90
    C:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\bin\gfortran.exe -Wall -g -Wall -g -shared build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalibmodule.o build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\fortranobject.o build\temp.win-amd64-2.7\Release\igakit\igalib.o build\temp.win-amd64-2.7\Release\build\src.win-amd64-2.7\igakit\igalib-f2pywrappers2.o -LC:\Program_Files\mingw-w64\x86_64-7.1.0-posix-sjlj-rt_v5-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\7.1.0 -LC:\Python27\libs -LC:\Python27\PCbuild\amd64 -LC:\Python27\PC\VS9.0\amd64 -lpython27 -lgfortran -lgfortran -o build\lib.win-amd64-2.7\igakit\igalib.pyd
    running install_lib
    creating C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\cad.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\igalib.pyd -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\io.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\nurbs.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\plot.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\plot_mpl.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\plot_myv.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\plot_nul.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\transform.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    copying build\lib.win-amd64-2.7\igakit\__init__.py -> C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\cad.py to cad.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\io.py to io.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\nurbs.py to nurbs.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\plot.py to plot.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\plot_mpl.py to plot_mpl.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\plot_myv.py to plot_myv.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\plot_nul.py to plot_nul.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\transform.py to transform.pyc
    byte-compiling C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit\__init__.py to __init__.pyc
    writing byte-compilation script 'c:\users\username\appdata\local\temp\tmplxgwso.py'
    C:\Python27\python.exe -O c:\users\username\appdata\local\temp\tmplxgwso.py
    removing c:\users\username\appdata\local\temp\tmplxgwso.py
    running install_egg_info
    Writing C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit-0.1-py2.7.egg-info
    running install_clib
    

    And it ends like that and without a final confirmation sentence to state whether the installation process went successful or not like what I've seen before with other packages when installing using pip and wheel files, so I went to the directory "C:\Python27\Lib\site-packages" (which is the ordinary place for installed packages) and didn't see any folder named igakit or something related to it, so I went to the directory "C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages" which appeared in the command prompt and found a folder and a file

    igakit <Directory>
    igakit-0.1-py2.7.egg-info
    

    and within igakit directory these files are located

    cad.py
    cad.pyc
    cad.pyo
    igalib.pyd
    io.py
    io.pyc
    io.pyo
    nurbs.py
    nurbs.pyc
    nurbs.pyo
    plot.py
    plot.pyc
    plot.pyo
    plot_mpl.py
    plot_mpl.pyc
    plot_mpl.pyo
    plot_myv.py
    plot_myv.pyc
    plot_myv.pyo
    plot_nul.py
    plot_nul.pyc
    plot_nul.pyo
    transform.py
    transform.pyc
    transform.pyo
    __init__.py
    __init__.pyc
    __init__.pyo
    

    Therefore I'm a bit confused if the installation is complete and these files are all the needed output from the building operation or not, But anyway and even though you've never built the package on Windows, I do appreciate your suggestion.

  4. Lisandro Dalcin repo owner

    I agree the output is lacking some more explicit confirmation about success, but please note this is not something I can fix, it is just how Python's distutils and setuptools work. Sorry.

    Everything seems to be fine, igakit was installed inside your user or home directory under C:\Users\UserName\AppData\Roaming\Python\Python27\site-packages\igakit, and not in the Python system location. You should be able to use igakit installed from there. Python documents this here https://docs.python.org/2/library/site.html#site.USER_SITE

    If instead you want to install in the system Python location, run python setup.py install, without the --user flag.

    Now, try to run any of the demo scripts under demo/ in the igakit source directory. Let me know whether it worked or not.

  5. Serag Hassouna reporter

    Yes it did work, Almost of the demo scripts worked and displayed their graphics, but 3 of them raise errors at site-package's nurbs.py as following:

    1- createcfrom1line.py :-

    after changing

    from cad import line
    

    to

    from igakit.cad import line
    

    it raises an AssertionError in

     __init__, line 163,
    assert k.size>= 4
    

    when calling: C.append(NURBS(P,[[0,0,0,1,1,1]])) in line 72

    2- venturi.py and volumify.py:-

    they raise an AssertionError in

    __init__, line 160
    assert len(knots) <= 3
    

    in venturi.py when calling: tube = NURBS(P,[U,V]) in line 88

    and in volumify.py when calling: nrb = NURBS(Pw, [U,W]) in line 106


    However, I saw what python docs says about the assert statement and understood that AssertionErrors are triggered "in purpose" if the expression's evaluation returns FALSE, therefore I think installation is successful.

  6. Log in to comment