Open GoogleCodeExporter opened 9 years ago
I overcame this by removing all the -mno-cygwin references from
cygwinccompiler.py in distutils. However, this leads onto a new error which is:
building 'ueye.constants' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -I. -IC:\Python27\include -IC:\Python27\PC
-c ueye\constants.c -o build\temp.win32-2.7\Release\ueye\constants.o -D__LINUX__
ueye\constants.c:312:18: fatal error: uEye.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
My uEye is installed at: C:\Program Files\IDS\uEye
Any ideas?
Original comment by laurence...@gmail.com
on 30 May 2013 at 4:18
On Windows the compiler seems to be unable to locate a couple of the required
files (specifically uEye.h and uEye_api.lib/uEye_api_64.lib from the uEye
installation directory). I got around this by dropping them into an include
directory and adding it both to include_dirs in setup.py and to the LIB
environment variable. (I also had to throw a few Python files in there, but I
suspect that's due to my choice of Python distribution.)
Because IDS's versioning is slightly different between Linux and Windows you
might want to grab these files from the Linux drivers. Alternatively, the
closest match I found was to use the July 2013 version of pyueye with the .h
and .lib files from the Windows version of uEye 3.82. The only change that then
needs to be made to pyueye is to remove the 2 lines in constants.pyx which
mention the UI233X sensors.
I was also getting syntax errors from uEye.h due to the IDSEXP/IDSEXPUL
defines. There appears to be a redundant check for whether c or c++ is being
used (the whole file is in a extern "C" block) and the c++ defines are wrongly
selected. If you remove "defined (_PURE_C) &&" from the if statement
immediately after "#include <windows.h>" it should fix the problem.
After that the wrapper compiled fine for me using the Windows SDK compilers.
Also, don't forget to change extra_compile_args in setup.py to the appropriate
platform.
Original comment by rst...@gmail.com
on 19 Aug 2013 at 3:01
Win 8.1 Pro 64bit, installation issue.
I edited the setup.py file to include the dirs with uEye.h and uEye_api_64.lib
include_dirs = [".", r'c:\Program Files\IDS\uEye\Develop\Lib', r'c:\Program
Files\IDS\uEye\Develop\include', r'd:\install\pyueye-4.20-rev19\trunk\ueye'],
# adding the '.' to include_dirs is CRUCIAL!!
removed "defined (_PURE_C) &&" from the if statement in uEye.h
Still errors occur.. does someone know, how to fix it?
MSVC2012 64bit
Original comment by ivan.pir...@gmail.com
on 12 Aug 2014 at 3:41
Attachments:
It's down to versioning issues between the Linux and Windows drivers. Looks
like constants.pyx refers to a load of identifiers that aren't defined in the
current Windows version of uEye.h. Just comment out the offending lines in
constants.pyx (for example, lines 529 to 577).
Original comment by rst...@gmail.com
on 14 Aug 2014 at 11:17
I'm trying to install the latest version on a 64-bit Windows 10 machine with 64-bit Python without success. I had to alter setup.py for usage with Python 3 (brackets around print statements), i removed the commands import and added the lib and include dirs in the include_dirs list. Still getting errors:
ueye\ueye.pyx: cannot find cimported module 'python_cobject'
Compiling ueye\ueye.pyx because it changed.
Compiling ueye\ueyeh.pyx because it changed.
[1/2] Cythonizing ueye\ueye.pyx
Error compiling Cython file:
------------------------------------------------------------
...
#
# Author: Ricardo Amezquita Orozco <ramezquitao@cihologramas.com>
# Functions definition
from stdlib cimport *
^
------------------------------------------------------------
ueye\ueye.pyx:36:0: 'stdlib.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
# Author: Ricardo Amezquita Orozco <ramezquitao@cihologramas.com>
# Functions definition
from stdlib cimport *
from python_cobject cimport *
^
------------------------------------------------------------
ueye\ueye.pyx:37:0: 'python_cobject.pxd' not found
warning: ueye\ueye.pyx:2681:20: Non-trivial type declarators in shared declaration (e.g. mix of pointers and values). Each pointer declaration should be on its own line.
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
^
------------------------------------------------------------
ueye\ueye.pyx:438:35: undeclared name not builtin: calloc
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
^
------------------------------------------------------------
ueye\ueye.pyx:438:22: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
^
------------------------------------------------------------
ueye\ueye.pyx:438:22: Python objects cannot be cast to pointers of primitive types
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
^
------------------------------------------------------------
ueye\ueye.pyx:438:22: Storing unsafe C derivative of temporary Python reference
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
self.Imgs = <char **>calloc(bufCount, sizeof(char*))
^
------------------------------------------------------------
ueye\ueye.pyx:439:20: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
self.Imgs = <char **>calloc(bufCount, sizeof(char*))
^
------------------------------------------------------------
ueye\ueye.pyx:439:20: Python objects cannot be cast to pointers of primitive types
Error compiling Cython file:
------------------------------------------------------------
...
#Set colormode and assign image memory. The image memory assigment is done
#in SetColorMode
self.BufCount = bufCount
self.BufIds = <int *>calloc(bufCount, sizeof(int))
self.Imgs = <char **>calloc(bufCount, sizeof(char*))
^
------------------------------------------------------------
ueye\ueye.pyx:439:20: Storing unsafe C derivative of temporary Python reference
Error compiling Cython file:
------------------------------------------------------------
...
Return Value:
=============
eeprom: Depending on "raw" parameter, either a list or a 'bytes' string
containing the user EEPROM.
'''
cdef char *c_eeprom = <char*>calloc( 64, sizeof(char) )
^
------------------------------------------------------------
ueye\ueye.pyx:743:30: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
Return Value:
=============
eeprom: Depending on "raw" parameter, either a list or a 'bytes' string
containing the user EEPROM.
'''
cdef char *c_eeprom = <char*>calloc( 64, sizeof(char) )
^
------------------------------------------------------------
ueye\ueye.pyx:743:13: Storing unsafe C derivative of temporary Python reference
Error compiling Cython file:
------------------------------------------------------------
...
count += 1
if count + addr > 64:
raise Exception( "Attempted to write past end of 64-byte EEPROM." )
cdef char *c_eeprom = <char*>calloc( 64, sizeof(char) )
^
------------------------------------------------------------
ueye\ueye.pyx:788:30: Casting temporary Python object to non-numeric non-Python type
Error compiling Cython file:
------------------------------------------------------------
...
count += 1
if count + addr > 64:
raise Exception( "Attempted to write past end of 64-byte EEPROM." )
cdef char *c_eeprom = <char*>calloc( 64, sizeof(char) )
^
------------------------------------------------------------
ueye\ueye.pyx:788:13: Storing unsafe C derivative of temporary Python reference
Traceback (most recent call last):
File "setup.py", line 60, in <module>
ext_modules=cythonize(extensions),
File "C:\Users\me\AppData\Local\Programs\Python\Python36\lib\site-packages\Cython\Build\Dependencies.py", line 934, in cythonize
cythonize_one(*args)
File "C:\Users\me\AppData\Local\Programs\Python\Python36\lib\site-packages\Cython\Build\Dependencies.py", line 1056, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: ueye\ueye.pyx
Ideas anybody?
Original issue reported on code.google.com by
Ca5u5usu...@gmail.com
on 11 Feb 2013 at 6:43