On Wednesday 11 August 2021 04:07:59 Rene Hopf via Emc-developers wrote:
> > On 11. Aug 2021, at 10:04, Rob C <[email protected]> wrote:
> >
> > Could it be:
> > ImportError: No module named hal
> >
> > ....
> >
> > Therefore have you installed python3, given master has now changed
> > to Python3, this may (will) also require GTK2 to become GTK3 and
> > some of the dependencies will need to be located in the python3
> > dependencies folder and not within the python2 folder (depending
> > upon what gui you are using).
>
> Exactly. Run 2to3 -w on the file, and change the first line to
> python3, that should fix it.
>
I did not know about 2to3, first I've read of it.
See my appended reply below, python to python3 using nano fixed it.
I also have since done a survey of sorts with htop while LinuxCNC was
running. That system now has NO python2 loaded and running. And a
wintel box, running the same scripts only has one python2 straggler
left, wicd, which is not your problem. wicd could be removed as my local
net is host file based.
I am pleased, and somewhat amazed that the conversion to python3 by
LinuxCNC has been as painfree as it has been. Everything I have done in
pyvcp (and there is a bunch of that on 4 machines) still works as I
intended. A quick tip of my hat in respect for the coders who made it
that painless.
Thank you very much.
> >> I see Jeff did something to python, but its still the same failure.
> >>
> >> units.py is quite simple.
> >> ===========
> >> #!/usr/bin/env python
> >> import hal, time, linuxcnc
> >> h = hal.component("units")
> >> h.newpin("G21", hal.HAL_BIT, hal.HAL_OUT)
> >> h.newpin("G20", hal.HAL_BIT, hal.HAL_OUT)
> >> h.ready()
> >> s = linuxcnc.stat()
> >> try:
> >> while 1:
> >> time.sleep(1)
> >> s.poll()
> >> if s.program_units == 1:
> >> h['G21'] = 0
> >> h['G20'] = 1
> >> else:
> >> h['G21'] = 1
> >> h['G20'] = 0
> >> except KeyboardInterrupt:
> >> raise SystemExit
> >> =============
> >> That is it in its entirety. But changing line one from python to
> >> python3 fixed it. It running normally now ANAICT.
> >>
> >> Thank you Jeff.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers