Python script ImportError: No module named 'linuxcnc'

More
27 Nov 2019 06:43 #151337 by SBWZFH
Hi everybody. First post. I am currently learning python and I am currently playing around with Linuxcnc. I installed it on a Raspberry pi 3 just to get familiar with it as I will be using it more in the near future. I am writing a python script, but am having this error when I try to run it or any other linuxcnc script.
ImportError: No module named 'linuxcnc'

I used the shell script from github.com/jefffall/build-linuxcnc-on-raspberry-pi-or-ubuntu for my installation.

As I said, I am still learning python, and after hours of googling, I have come up with nothing..

Thanks in advance for your help.

Steve.

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

More
27 Nov 2019 16:43 #151361 by pl7i92
did you start linuxcnc for a first time alredy on the pi
then it shoudt also be importable

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

More
27 Nov 2019 16:47 #151364 by SBWZFH
I did. I have tried to run the script with linuxcnc running and not..

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

More
27 Nov 2019 18:56 #151380 by AK
Hi all,

I am a new user working on a project to build mtconnect adpater for a Tormach CNC machine. I am trying to import linux cnc but I am also getting the same error 'ImportError: No module named 'linuxcnc''. While I am running the UI of the machine, I can see that the internal codes are using import linuxcnc, and the machine is working fine. But still i am unable to import it in command shell.

It would be really great if someone can help towards this concern.

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

More
27 Nov 2019 19:40 #151387 by AK
Hi,

I tried these steps and it worked:
> git clone git://github.com/linuxcnc/linuxcnc.git linuxcnc-dev
> cd linuxcnc-dev/src
> ./autogen.sh
> ./configure --with-realtime=uspace
> make
> sudo make setuid
> source ../scripts/rip-environment
> runtests

After the test is done successfully, just try :
->source ../scripts/rip-environment
->python
->import linuxcnc

It should work!

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

More
27 Nov 2019 20:37 #151392 by SBWZFH
Sweet! I will give that a try and update this evening..

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

More
28 Nov 2019 02:40 #151403 by SBWZFH
Ok, that works, but only for that specific terminal instance. How do I make this more permanent?

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

More
28 Nov 2019 05:32 - 28 Nov 2019 05:34 #151405 by grandixximo
I normally follow this procedure, not sure if it will work on the rpi3
linuxcnc.org/docs/master/html/code/building-linuxcnc.html
Check your dependency are all good point 4, then follow point 3.2 and you should find in your home directory linuxcnc-uspace-2.xx..deb package that you can install, once that is installed it's permanent you can run linuxcnc from any terminal and you should also have it in the start menu, and you can also uninstall like other programs from software manager or with apt or dpkg from terminal.
Last edit: 28 Nov 2019 05:34 by grandixximo.

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

More
29 Nov 2019 19:41 #151519 by AK
It is working, but once I restart the system everything has to be done again. Any solution for that?

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

More
01 Dec 2019 17:41 #151673 by rodw

It is working, but once I restart the system everything has to be done again. Any solution for that?


Thats not specific to the RPI. Thats how it is.

On mint I saved a shortcut and modified it to run the last config Linuxcnc opened and load the rip-environment on statrtup.
But if you are working from the command line, you still need to run the script. Usually hitting the up arrow retrieves the command.

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

Time to create page: 0.117 seconds
Powered by Kunena Forum