[comedi] Libcomedi python3 binding on Ubuntu 24.04 / Debian 12
Han Hartgers <[email protected]> Tue, 6 May 2025 07:29:06 -0700 (PDT)
| Newsgroups | gmane.linux.comedi |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_76148_496801891.1746541746166
Content-Type: multipart/alternative;
boundary="----=_Part_76149_706900464.1746541746166"
------=_Part_76149_706900464.1746541746166
Content-Type: text/plain; charset="UTF-8"
Dear all,
Can it be that the python bindings for libcomedi are not working for
python3.x?
I tried the example on my ubuntu 24.04 (and Debian 12) and I get the
following error:
hansan@Desk-computer:~$ python
Python 3.12.3 (main, Feb 4 2025, 14:48:35) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import comedi
>>> device = comedi.comedi_open("/dev/comedi0")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'comedi' has no attribute 'comedi_open'
>>>
This does work on older Ubuntu versions like 18.04. Is there a way to fix
this?
I also tried pycomedi (https://pypi.org/project/pycomedi/) but that has
trouble to get compiled.
My problem looks to be similar as of Bernd Porr in 2018
See https://groups.google.com/g/comedi_list/c/MjI7FGp_Xyw/m/J5n2dlIoBAAJ
There it was suggested that libcomedi 0.11.x would/could solve this. But
that does not look to be the case:
hansan@Desk-computer:~$ sudo apt list --installed | grep -i comedi
libcomedi-dev/noble,now 0.11.0+5-1.1build1 amd64 [installed]
libcomedi0t64/noble,now 0.11.0+5-1.1build1 amd64 [installed]
python3-comedilib/noble,now 0.11.0+5-1.1build1 amd64 [installed]
hansan@Desk-computer:~$ uname -a
Linux Desk-computer 6.8.0-59-lowlatency #61.1-Ubuntu SMP PREEMPT_DYNAMIC
Fri Apr 18 11:13:23 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Is there a way to fix this all to use Python3 to interface with comedi
based measurement cards ?
Kind regards,
Han
--
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 [email protected].
To view this discussion visit https://groups.google.com/d/msgid/comedi_list/1f36f4a0-08b9-46ee-9666-aafe68dd4731n%40googlegroups.com.
------=_Part_76149_706900464.1746541746166
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div>Dear all,</div><div><br /></div><div>Can it be that the python binding=
s for libcomedi are not working for python3.x?</div><div><br /></div><div>I=
tried the example on my ubuntu 24.04 (and Debian 12) and I get the followi=
ng error:</div><div><span style=3D"font-family: Courier New;">hansan@Desk-c=
omputer:~$ python<br />Python 3.12.3 (main, Feb =C2=A04 2025, 14:48:35) [GC=
C 13.3.0] on linux<br />Type "help", "copyright", "credits" or "license" fo=
r more information.<br />>>> import comedi<br />>>> devic=
e =3D comedi.comedi_open("/dev/comedi0")<br />Traceback (most recent call l=
ast):<br />=C2=A0 File "<stdin>", line 1, in <module><br />Attr=
ibuteError: module 'comedi' has no attribute 'comedi_open'<br />>>>=
;=C2=A0</span></div><div><br /></div><div>This does work on older Ubuntu ve=
rsions like 18.04.=C2=A0 Is there a way to fix this?</div><div><br /></div>=
<div>I also tried pycomedi (https://pypi.org/project/pycomedi/)=C2=A0 but t=
hat has trouble to get compiled. <br /></div><div><br /></div><div>My probl=
em looks to be similar as of Bernd Porr in 2018 <br /></div><div>See https:=
//groups.google.com/g/comedi_list/c/MjI7FGp_Xyw/m/J5n2dlIoBAAJ</div><div><b=
r /></div><div>There it was suggested that libcomedi 0.11.x would/could sol=
ve this. But that does not look to be the case:</div><div><br /></div><div>=
<span style=3D"font-family: Courier New;">hansan@Desk-computer:~$ sudo apt =
list --installed | grep -i comedi<br /></span></div><div><span style=3D"fon=
t-family: Courier New;">libcomedi-dev/noble,now 0.11.0+5-1.1build1 amd64 [i=
nstalled]<br />libcomedi0t64/noble,now 0.11.0+5-1.1build1 amd64 [installed]=
<br />python3-comedilib/noble,now 0.11.0+5-1.1build1 amd64 [installed]<br /=
></span></div><div><span style=3D"font-family: Courier New;">hansan@Desk-co=
mputer:~$ uname -a<br />Linux Desk-computer 6.8.0-59-lowlatency #61.1-Ubunt=
u SMP PREEMPT_DYNAMIC Fri Apr 18 11:13:23 UTC 2025 x86_64 x86_64 x86_64 GNU=
/Linux<br /></span><br /></div><div>=C2=A0Is there a way to fix this all to=
use Python3 to interface with comedi based measurement cards ?</div><div><=
br /></div><div>Kind regards,</div><div><br /></div><div>Han</div><div><br =
/></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Comedi: Linux Control and Measurement Device Interface" group.<br=
/>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">comedi_=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
comedi_list/1f36f4a0-08b9-46ee-9666-aafe68dd4731n%40googlegroups.com?utm_me=
dium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/comedi_=
list/1f36f4a0-08b9-46ee-9666-aafe68dd4731n%40googlegroups.com</a>.<br />
------=_Part_76149_706900464.1746541746166--
------=_Part_76148_496801891.1746541746166--