Python script ImportError: No module named 'linuxcnc'

More
03 Dec 2019 00:44 #151795 by andypugh
There is a (deprecated) way to get round that, by using the --with-prefix when running ./configure. You can put the files in /usr/ but then no package manager is tracking them so updating and uninstalling is hard.

On x86 you can use buildbot packages, but there currently are none for the Pi.

You could try building your own .deb and installing that, but I didn't have much luck making debs on the Pi.

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

More
13 Aug 2020 07:23 #178077 by creigelde
You need a file named __init__.py (two underscores on each side) in every folder in the hierarchy. This is what python looks for to know that it should access a particular folder. The files are meant to contain initialization instructions but even if you create them empty this will solve it. To get rid of this error “ImportError: No module named”, you just need to create __init__.py in the appropriate directory and everything will work fine.

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

More
03 Jan 2021 09:14 #193934 by frequency
I created an .xsessionrc file in my home folder with the output of
$ source rip-environment
without the first lines after the lines of the QtPyVCP installation script:

# added py QtPyVCP install script

if [ -d $HOME/.local/bin ]; then
export PATH="$HOME/.local/bin:$PATH"
fi

#From here downwards

EMC2_HOME=/home/cnc-pc/linuxcnc; export EMC2_HOME
EMC2VERSION="2.8.1"; export EMC2VERSION
LINUXCNCVERSION="2.8.1"; export LINUXCNCVERSION
LINUXCNC_NCFILES_DIR="/home/cnc-pc/linuxcnc/nc_files"; export LINUXCNC_NCFILES_DIR
LINUXCNC_EMCSH=/usr/bin/wish8.6; export LINUXCNC_EMCSH
PATH=/home/cnc-pc/linuxcnc/bin:$EMC2_HOME/scripts:$EMC2_HOME/tcl:"$PATH"

if [ -z "$TCLLIBPATH" ]; then
TCLLIBPATH=$EMC2_HOME/tcl
else
TCLLIBPATH=$EMC2_HOME/tcl:$TCLLIBPATH
fi

if [ -z "$LD_LIBRARY_PATH" ]; then
LD_LIBRARY_PATH=$EMC2_HOME/lib
else
LD_LIBRARY_PATH=$EMC2_HOME/lib:"$LD_LIBRARY_PATH"
fi

if [ -z "$PYTHONPATH" ]; then
PYTHONPATH=$EMC2_HOME/lib/python
else
PYTHONPATH=$EMC2_HOME/lib/python:"$PYTHONPATH"
fi

if [ -z "$MANPATH" ]; then
if type -path manpath > /dev/null 2>&1; then
MANPATH=$EMC2_HOME/docs/man:"$(manpath)"
else
MANPATH=$EMC2_HOME/docs/man:/usr/local/man:/usr/local/share/man:/usr/share/man
fi
else
MANPATH=$EMC2_HOME/docs/man:"$MANPATH"
fi

if [ -z "$GLADE_CATALOG_PATH" ]; then
GLADE_CATALOG_PATH=$EMC2_HOME/lib/python/gladevcp
else
GLADE_CATALOG_PATH=$EMC2_HOME/lib/python/gladevcp:"$GLADE_CATALOG_PATH"
fi

if ! $as_command; then
# TODO: if these completion directives give trouble for any versions
# of bash actively in use, protect them with checks of BASH_VERSINFO
if [ $BASH_VERSINFO -eq 2 ]; then
complete -o dirnames -f -X '!*.ini' emc axis mdi
complete -o dirnames -f -X '!*.hal' halrun halcmd
complete -W 'start stop restart status' realtime
complete -C "halcmd -C" halcmd
else
_iningc () {
case "$3" in
*.ini) COMPREPLY=($(compgen -o plusdirs -f -X '!*.ngc' -- "$2")) ;;
*) COMPREPLY=($(compgen -o plusdirs -f -X '!*.ini' -- "$2"))
esac
}
complete -o plusdirs -F _iningc emc axis
complete -o plusdirs -f -X '!*.ini' mdi
complete -o plusdirs -f -X '!*.hal' halrun halcmd
complete -W 'start stop restart status' realtime
complete -C "halcmd -C" halcmd
fi

if [ -f $EMC2_HOME/src/Makefile ]; then
build () { make -C $EMC2_HOME/src "$@"; }
fi
fi

export PYTHONPATH MANPATH LD_LIBRARY_PATH TCLLIBPATH GLADE_CATALOG_PATH

if $as_command; then exec "$@"; fi

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

Time to create page: 0.070 seconds
Powered by Kunena Forum