python - ImportError: No module named 'hal'

55 views
Skip to first unread message

klemen dovrtel

unread,
Jan 20, 2024, 11:55:18 AMJan 20
to Machinekit
Hello everybody,

I am testing a simple passthrough python module. When I start $halrun and
halcmd: loadusr passthrough.py
I get an error message:
import hal
ImportError: No module named 'hal'

Does anybody have an idea what is the problem when I try to load the python module from hal? When I start $python instead and try to >>> import hal within python, I get no complaints about missing hal module.

Regards
Klemen

--------------------------
My system:
$uname -a
Linux beaglebone 4.19.120-bone-rt-r50 #1stretch PREEMPT RT Fri May 8 22:45:31 UTC 2020 armv7l GNU/Linux

$ python -V
Python 2.7.13

passthrough.py module: 

klemen dovrtel

unread,
Jan 21, 2024, 1:55:10 AMJan 21
to Machinekit
Hello everybody,

I think I found the problem myself :) That particular python script was run from python3 (#!/usr/bin/env python3).
I changed this to #!/usr/bin/env python2.7 and now I don't get this error message any more.

Regards
Klemen


Reply all
Reply to author
Forward
0 new messages