Python Component - $PATH

More
3 years 3 months ago #274839 by zz912
Hello,

what is $PATH ???

make it executable (chmod +x), and place it on your $PATH

linuxcnc.org/docs/2.9/html/hal/halmodule.html

I am trying to make a python component according to the instructions. It's not working, any idea why?
Code:
jarda@CNC:~/linuxcnc/linuxcnc-2.9/configs/sim/gmoccapy/python$ ls passthrough  remap.py  stdglue.py  toplevel.py jarda@CNC:~/linuxcnc/linuxcnc-2.9/configs/sim/gmoccapy/python$ halrun halcmd: loadusr passthrough <stdin>:1: execv(passthrough): No such file or directory halcmd:

Please Log in to join the conversation.

More
3 years 3 months ago #274840 by JPL
Replied by JPL on topic Python Component - $PATH

Code:
echo $PATH

Have a look here too:

opensource.com/article/17/6/set-path-linux

Please Log in to join the conversation.

More
3 years 3 months ago #274841 by zz912
Replied by zz912 on topic Python Component - $PATH
Thank you, it works for me now.

Please Log in to join the conversation.

More
3 years 3 months ago #274842 by MaHa
Replied by MaHa on topic Python Component - $PATH
I use the more comfortable way, keep the component within /home/user/...  environment. Also good for backup of the configuration. In storage folder of component open terminal here, then:

sudo halcompile --install --userspace yourcomponent.py

Please Log in to join the conversation.

More
3 years 3 months ago #274943 by zz912
Replied by zz912 on topic Python Component - $PATH
To MaHa:

I tried your way, but it did not work.
Code:
jarda@CNC:~/Plocha$ halcompile --install --userspace passthrough.py jarda@CNC:~/Plocha$ halrun halcmd: loadusr passthrough halcmd: Traceback (most recent call last):   File "/home/jarda/linuxcnc/linuxcnc-2.9/bin/passthrough", line 2, in <module>     h = hal.component("passthrough")         ^^^ NameError: name 'hal' is not defined

I cannot use "sudo", because I have RIP instalation.

Please Log in to join the conversation.

More
3 years 3 months ago #274979 by MaHa
Replied by MaHa on topic Python Component - $PATH
All info about is here and this worked for me:
linuxcnc.org/docs/stable/html/man/man1/halcompile.1.html

without root it might be difficult, but i don't know, as i have installed from .iso.

Please Log in to join the conversation.

More
3 years 3 months ago #274981 by tommylight
Replied by tommylight on topic Python Component - $PATH
Did you set the RIP environment before running those commands?
Just a stab in the dark as i have not used RIP for over 5 years or more.

Please Log in to join the conversation.

More
3 years 3 months ago #274990 by zz912
Replied by zz912 on topic Python Component - $PATH
If I didn't use rip-environment, halrun wouldn't work.

I also didn't write that I use Debian Bookworm.

Please Log in to join the conversation.

More
3 years 3 months ago #276086 by zz912
Replied by zz912 on topic Python Component - $PATH
I tested it in:
Debian GNU/Linux 10 (buster)  LCNC 2.8
Debian GNU/Linux 10 (buster)  LCNC 2.9

same error as here:
forum.linuxcnc.org/38-general-linuxcnc-q...omponent-path#274943
Code:
zdenek@CNC:~/linuxcnc/linuxcnc-2.9$ halcompile --install --userspace passthrough.py zdenek@CNC:~/linuxcnc/linuxcnc-2.9$ halrun halcmd: loadusr passthrough halcmd: Traceback (most recent call last):   File "/home/zdenek/linuxcnc/linuxcnc-2.9/bin/passthrough", line 2, in <module>     h = hal.component("passthrough") NameError: name 'hal' is not defined Note: Using POSIX realtime zdenek@CNC:~/linuxcnc/linuxcnc-2.9$ sudo halcompile --install --userspace passthrough.py [sudo] heslo pro zdenek:  sudo: halcompile: příkaz nenalezen
Code:
zdenek@CNC:~/linuxcnc/linuxcnc-2.8.4$ source scripts/rip-environment zdenek@CNC:~/linuxcnc/linuxcnc-2.8.4$ halcompile --install --userspace passthrough.py zdenek@CNC:~/linuxcnc/linuxcnc-2.8.4$ halrun halcmd: loadusr passthrough halcmd: Traceback (most recent call last):   File "/home/zdenek/linuxcnc/linuxcnc-2.8.4/bin/passthrough", line 2, in <module>     h = hal.component("passthrough") NameError: name 'hal' is not defined

 

Please Log in to join the conversation.

More
3 years 3 months ago #276110 by cmorley
Replied by cmorley on topic Python Component - $PATH
can you post the file for passthrough?

Please Log in to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum