lupa icon indicating copy to clipboard operation
lupa copied to clipboard

Binary instalation for windows python 2.7 64 or anaconda

Open secauvr opened this issue 11 years ago • 6 comments

I have tryed to build the lupa package for anaconda P2.7 64 and pyhon 2.7 64, but without success. I got this error when I use setup.py:

build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0x89): undefined reference to `_imp___Py_NoneStruct'
...
...
...
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: build\temp.win-amd64-2.7\Release\lupa\_lupa.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

When I try to compile using mingw environment I got this one:

F:\python64\lupa>gcc.exe -DMS_WIN64 -shared -s build\_lupa.o "C:\Program Files (x86)\Lua\5.1\lib\lua51.dll" build\_lupa.def -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\libs -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\PCbuild\amd64 -lpython27 -lmsvcr90 -o build\_lupa.pyd collect2.exe: error: ld returned 5 exit status and an access violation window.

Do you know how to fix it ? I tryed 3 different versions of mingw without success, or do you know where can I found the windows binary installation ?

Best regards, secauvr

secauvr avatar Mar 12 '14 19:03 secauvr

Could you provide the complete output?

scoder avatar Mar 16 '14 15:03 scoder

Using setup.py install --no-luajit

C:\Users\emilio\AppData\Local\Continuum\Anaconda\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 3.1.1\helpers\pydev\pydevd.py" --multiproc --client 127.0.0.1 --port 51468 --file F:/python64/lupa/setup.py install --no-luajit
pydev debugger: process 4520 is connecting

Connected to pydev debugger (build 133.881)
No local build of LuaJIT2 found in lupa directory
Checking for installed lua5.1 library using pkg-config
Did not find lua5.1 using pkg-config: pkg-config cannot find an installed lua5.1
Checking for installed lua-5.1 library using pkg-config
Did not find lua-5.1 using pkg-config: pkg-config cannot find an installed lua-5.1
Checking for installed lua library using pkg-config
Did not find lua using pkg-config: pkg-config cannot find an installed lua
Neither LuaJIT2 nor Lua 5.1 were found, please install the library and its development packages, or put a local build into the lupa main directory
building without Cython
running install
running bdist_egg
running egg_info
writing lupa.egg-info\PKG-INFO
writing top-level names to lupa.egg-info\top_level.txt
writing dependency_links to lupa.egg-info\dependency_links.txt
reading manifest file 'lupa.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
writing manifest file 'lupa.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying lupa\version.py -> build\lib.win-amd64-2.7\lupa
running build_ext
building 'lupa._lupa' extension
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall "-IC:\Program Files (x86)\Lua\5.1\include" -IC:\Users\emilio\AppData\Local\Continuum\Anaconda\include -IC:\Users\emilio\AppData\Local\Continuum\Anaconda\PC -c lupa/_lupa.c -o build\temp.win-amd64-2.7\Release\lupa\_lupa.o
lupa/_lupa.c: In function '__Pyx_RaiseArgtupleInvalid':
lupa/_lupa.c:20022:18: warning: unknown conversion type character 'z' in format [-Wformat=]
                  (num_expected == 1) ? "" : "s", num_found);
                  ^
lupa/_lupa.c:20022:18: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'Py_ssize_t' [-Wformat=]
lupa/_lupa.c:20022:18: warning: unknown conversion type character 'z' in format [-Wformat=]
lupa/_lupa.c:20022:18: warning: too many arguments for format [-Wformat-extra-args]
lupa/_lupa.c: In function '__Pyx_RaiseNeedMoreValuesError':
lupa/_lupa.c:20636:18: warning: unknown conversion type character 'z' in format [-Wformat=]
                  index, (index == 1) ? "" : "s");
                  ^
lupa/_lupa.c:20636:18: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' [-Wformat=]
lupa/_lupa.c:20636:18: warning: too many arguments for format [-Wformat-extra-args]
lupa/_lupa.c: In function '__Pyx_RaiseTooManyValuesError':
lupa/_lupa.c:20641:18: warning: unknown conversion type character 'z' in format [-Wformat=]
                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
                  ^
lupa/_lupa.c:20641:18: warning: too many arguments for format [-Wformat-extra-args]
writing build\temp.win-amd64-2.7\Release\lupa\_lupa.def
C:\MinGW\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\lupa\_lupa.o "C:\Program Files (x86)\Lua\5.1\lib\lua51.dll" build\temp.win-amd64-2.7\Release\lupa\_lupa.def -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\libs -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\PCbuild\amd64 -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\lupa\_lupa.pyd
build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0x89): undefined reference to `_imp___Py_NoneStruct'
build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0xbe): undefined reference to `_imp___Py_NoneStruct'
[...]
build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0x183ea): undefined reference to `_imp__PyType_Ready'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: build\temp.win-amd64-2.7\Release\lupa\_lupa.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Process finished with exit code -1

-----------------------------------------------------------------------------------------------------------------
Using command line I got a access violation window with mingw32 and mingw64, below are both outputs:

F:\python64\lupa>C:\mingw64\bin\gcc.exe --version
gcc.exe (rubenvb-4.8.0) 4.8.0
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

F:\python64\lupa>C:\mingw\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd
64-2.7\Release\lupa\_lupa.o "C:\Program Files (x86)\Lua\5.1\lib\lua51.dll" build
\temp.win-amd64-2.7\Release\lupa\_lupa.def -LC:\Users\emilio\AppData\Local\Conti
nuum\Anaconda\libs -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\PCbuild\am
d64 -lpython27-lmsvcr90 -o build\lib.win-amd64-2.7\lupa\_lupa.pyd
collect2.exe: error: ld returned 5 exit status


F:\python64\lupa>C:\mingw\bin\gcc.exe --version
gcc.exe (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

F:\python64\lupa>C:\mingw\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd64
-2.7\Release\lupa\_lupa.o "C:\Program Files (x86)\Lua\5.1\lib\lua51.dll" build\t
emp.win-amd64-2.7\Release\lupa\_lupa.def -LC:\Users\emilio\AppData\Local\Continu
um\Anaconda\libs -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\PCbuild\amd6
4 -lpython27-lmsvcr90 -o build\lib.win-amd64-2.7\lupa\_lupa.pyd
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin
d -lpython27-lmsvcr90
collect2.exe: error: ld returned 1 exit status

secauvr avatar Mar 17 '14 12:03 secauvr

Thanks. I removed the redundant parts of the output and formatted them. The gcc failures in your manual tries at the and are due to copy&paste errors (there is a space missing between the library references).

Not sure why the normal compilation fails, though. Well, one thing: it shouldn't be linking against libpython (i.e. the "-lpython27" is incorrect). Does it build when you remove that?

scoder avatar Mar 25 '14 10:03 scoder

Thanks, the library file was generated, but I got a error in the second step, where is generates the pyd file. The command line used is: C:\MinGW\bin\gcc.exe -DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\lupa_lupa.o F:\python64\Lua\5.1\lib\lua51.dll build\temp.win-amd64-2.7\Release\lupa_lupa.def -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\libs -LC:\Users\emilio\AppData\Local\Continuum\Anaconda\PCbuild\amd64 -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\lupa_lupa.pyd And the error is: build\temp.win-amd64-2.7\Release\lupa_lupa.o:_lupa.c:(.text+0x89): undefined reference to _imp___Py_NoneStruct' build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0xbe): undefined reference to_imp___Py_NoneStruct' build\temp.win-amd64-2.7\Release\lupa_lupa.o:_lupa.c:(.text+0xf3): undefined reference to _imp___Py_NoneStruct' build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0x213): undefined reference to_imp___Py_NoneStruct' build\temp.win-amd64-2.7\Release\lupa_lupa.o:_lupa.c:(.text+0x257): undefined reference to _imp___PyThreadState_Current' build\temp.win-amd64-2.7\Release\lupa\_lupa.o:_lupa.c:(.text+0x2e4): undefined reference to_imp___PyThreadState_Current' build\temp.win-amd64-2.7\Release\lupa_lupa.o:_lupa.c:(.text+0x32c): undefined reference to `_imp___PyThreadState_Current'

... (a lot of undefined references)

build\temp.win-amd64-2.7\Release\lupa_lupa.o:_lupa.c:(.text+0x183ea): undefined reference to _imp__PyType_Ready' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: build\temp.win-amd64-2.7\Release\lupa\_lupa.o: bad reloc address 0x0 in section.data' collect2.exe: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1

I researched about this problem and the solution mentioned is use the -DMS_WIN64 flag, but I'm already use this one an not fix de problem.

I put the files in sendspace if it heps you: http://www.sendspace.com/filegroup/rsKiq7tvIVWCr%2BQvOjFUWg

Thanks for you help

secauvr avatar Mar 27 '14 13:03 secauvr

I successful built lupa, but lupa.pyd throw a access violation in the 64 bits version with this simple code:

from lupa import LuaRuntime lua_rt = LuaRuntime() print(lua_rt)

Do you know where can I find the binary installation for python 2.7 64 bits windows ?

secauvr avatar Jul 02 '14 13:07 secauvr

I know this is an old thread, but you can find Python 2.7.5 64bit here: https://www.python.org/downloads/windows/

Scroll down until you see Python 2.7.5 - 2013-05-12 Then look for Download Windows x86-64 MSI installer

coolq1000 avatar Jul 13 '17 23:07 coolq1000