LinuxCNC 2.9 Python module linuxcnc error

More
29 Oct 2022 12:39 #255373 by chili023
I want to use the compensation.py methode for autoleveling of my mill.
while loading linuxcnc the pyhton script tries to load the module linuxcnc but cannot find it.
I had to install numpy and spicy before but pip cannot find a module called linuxcnc.
Traceback (most recent call last):
  File "compensation.py", line 27, in <module>
    import linuxcnc
ImportError: No module named linuxcnc
I assume the script is running on python 2 since I used pip and not pip3.
However python3 has a module that is named linuxcnc.

Maybe someone can point me into the right direction.
I am running LINUXCNC - 2.9.0-pre0-7877-g15792c421

Thanks

 

File Attachment:

File Name: compensati...10-29.py
File Size:7 KB
 

File Attachment:

File Name: custom_202...29-2.hal
File Size:0 KB
 

File Attachment:

File Name: SilverGlid...29-2.hal
File Size:17 KB
 

File Attachment:

File Name: SilverGlid...29-2.ini
File Size:6 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 12:49 #255375 by cmorley
in linuxcnc 2.9 all python programs must use python3.

Chris

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 12:52 #255376 by chili023
ok how can I tell linuxcnc to use pyhton3 and not 2?

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 12:53 #255377 by cmorley
how did you install linuxcnc?

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 12:59 #255378 by chili023
with the package manager.
I started with the 2.8 iso and updated to 2.9.0-pre0-7877-g15792c421

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 13:23 #255380 by chili023
My linuxcnc installation is using python2.
When I open python3 in the termianl and try
import linuxcnc
I get no error.
If I do that in python (2.x) <I get the error.

How can I use python3 for .py files?

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 15:48 #255388 by chili023
I testet a other version of the compensation.py
also import hal doesn't work.

Also tried this in python3 and python in the termianl.
Same result
python gives the error and python3 doesn't

Can I assume that my linuxcnc is using python 2?

Please Log in or Create an account to join the conversation.

More
29 Oct 2022 22:48 #255414 by cmorley
what distribution are you using?

Sorry I always compile version so can't help much.
I didn't think there was a distribution that could run 2.8 and 2.9 because of the python version problem.
Hopefully someone else will chime in.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum