Hi all, is anybody using python3 and comedi under Bionic Beaver? Python 3.6.6 (default, Sep 12 2018, 18:26:19) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information.
import comedi as c dev=c.comedi_open('/dev/comedi0')
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'comedi' has no attribute 'comedi_open'
bp1@bp1-Precision-WorkStation-T5400:~/python$ python Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import comedi as c dev=c.comedi_open('/dev/comedi0')
You see it works under Python2 but not Python3. Is there another approach to it? /Bernd
-- www: http://www.berndporr.me.uk/ http://www.linux-usb-daq.co.uk/ http://www.imdb.com/name/nm3293421/ Mobile: +44 (0)7840 340069 Work: +44 (0)141 330 5237 University of Glasgow School of Engineering Rankine Building, Oakfield Avenue, Glasgow, G12 8LT
I've just tried Trevor's pycomedi. That's the output from pip below. Won't compile. I've also checked it out from his git. That installs but then the demo programs crash with internal errors. I guess it's hopelessly out of date? ;)
Was hoping to use Python3 and my USBDUX boxes for teaching but
seems to be virtually impossible?
/Bernd
/usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py:367:
FutureWarning: Cython directive 'language_level' not set, using 2
for now (Py2). This will change in a later release! File:
/tmp/pip-build-07z_v5yg/pycomedi/pycomedi/command.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
if self._cmd.chanlist is not NULL:
_stdlib.free(self._cmd.chanlist)
if self._cmd.data is not NULL:
_stdlib.free(self._cmd.data)
cdef _comedi_h.comedi_cmd *get_comedi_cmd_pointer(self)
except *:
^
------------------------------------------------------------
pycomedi/command.pyx:147:9: Signature not compatible with
previous declaration
Error compiling Cython file:
------------------------------------------------------------
...
cdef class Command (object):
cdef _comedi_h.comedi_cmd _cmd
cdef public list _fields
cdef _comedi_h.comedi_cmd *get_comedi_cmd_pointer(self)
^
------------------------------------------------------------
pycomedi/command.pxd:26:30: Previous declaration is here
building 'pycomedi.command' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g
-fstack-protector-strong -Wformat -Werror=format-security
-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC
-I/usr/lib/python3/dist-packages/numpy/core/include
-I/usr/include/python3.6m -c pycomedi/command.c -o
build/temp.linux-x86_64-3.6/pycomedi/command.o
pycomedi/command.c:1:2: error: #error Do not use this file, it
is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed
Cython compilation.
^~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status
1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-07z_v5yg/pycomedi/setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record /tmp/pip-k0nrw6m9-record/install-record.txt
--single-version-externally-managed --compile" failed with error
code 1 in /tmp/pip-build-07z_v5yg/pycomedi/
--
You received this message because you are subscribed to the Google Groups "Comedi: Linux Control and Measurement Device Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to comedi_list...@googlegroups.com.
To post to this group, send email to comed...@googlegroups.com.
Visit this group at https://groups.google.com/group/comedi_list.
For more options, visit https://groups.google.com/d/optout.