Error: No module named linuxcnc

More
29 Nov 2021 02:16 #227864 by Barry
When trying to run ncam.py the error message, "No module named linuxcnc" pops up.  Ncam.py is located under
/usr/share/linuxcnc/aux_gladevcp/NativeCAM/ncam.py

Please note that I've used Buster with Nativecam embedded in Linuxcnc Axis with no issues for over 9 months now; however, when I upgraded to the latest Linuxcnc build for Buster at buildbot.linuxcnc.org/,  Linuxcnc runs perfectly without ncam embeded but won't run with ncam embedded.  The issue is that the ncam program wants to import Linuxcnc but can't find the Linuxcnc module. 

I assume maybe that I need to install a global path under maybe .bashrc, or maybe a link from the/ usr/share/linuxcnc/aux_gladevcp/NativeCAM/ folder so ncam can find the Linuxcnc module, but I don't know the path to the Linuxcnc module location to try it.

It's weird that this happened, because I did this same upgrade earlier this year on a prior Linuxcnc build under Buster with no issues....it's most likely a pilot error this time.

Any suggestions you can provide would be most appreciated.

Thank you,

Barry  :)

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

More
29 Nov 2021 02:28 #227865 by tommylight
Moved to "NativeCAM"

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

More
03 Dec 2021 05:17 #228256 by Barry
After more trial and error this DOES NOT appear to be a NativeCam issue.

I found something interesting that may help troubleshoot this issue by those more knowledgeable of Linuxcnc than me.

Using fresh installs of Buster 2.9 and NativeCam......

Trial 1: Using Linuxcnc 2.8.2.
Open a terminal anywhere and type python. Then type import linuxcnc.
Python imports linuxcnc with no issues.

Trial 2: Using Buster Buildbot 2.9.0-pre0-3801-gd4ed11e17 (Note this is an older Buster buildbot version)
LinuxCNC launches perfectly.
Open a terminal anywhere and type python. Then type import linuxcnc.
Python imports linuxcnc with no issues.

Trial 3: Using linuxcnc Buildbot 2.9.0-pre0-5132-gaf2e71ae9 (This is the latest build)
Follow the directions on buildbot.linuxcnc.org/ to install
deb buildbot.linuxcnc.org/ buster master-rtpreempt
deb-src buildbot.linuxcnc.org/ buster master-rtpreempt
Note: After installation, LinuxCNC launches perfectly.
Open a terminal anywhere and type python. Then type import linuxcnc.
Python reports an error message: no module named linuxcnc

Note: NativeCam won't run because it can't import the module named linuxcnc under Linuxcnc Buildbot 2.9.0-pre0-5132-gaf2e71ae9!

Please let me know if you know a solution to this issue because I'm stuck.

Thank you,

Barry :)

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

More
03 Dec 2021 07:09 - 03 Dec 2021 07:13 #228261 by phillc54
LinuxCNC master branch uses python3, I have no clue if NativeCAM will run on python3

If you try entering python3 from a terminal you can then probably import linuxcnc.

You can change the default python to python3 by using update-alternatives.

Warning: Spoiler!
Attachments:
Last edit: 03 Dec 2021 07:13 by phillc54.

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

More
03 Dec 2021 14:53 #228287 by Barry
Yup it looks like you figured it out. Thank you! :) .....and as you suspected, the NativeCAM cam.py program as written does not run under Python 3, but Python 3 is required to run then latest Buster Linuxcnc 2.9 Master Branch version.

So to dig into the details a little more, I used a terminal, ran Python 3 and tried importing each module required to run NativeCAM. The following modules were "not found."

import gtk
import pygtk
pygtk.require('2.0')
from gtk import gdk
import pango
from lxml import etree
import ConfigParser
from cStringIO import StringIO
import pref_edit
import Tkinter

I'm not Python savvy enough yet to reprogram NativeCAM to run under Python 3 but if someone does know, please help.

Thank you again,

Barry :)

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

Time to create page: 0.098 seconds
Powered by Kunena Forum