Python4Lazarus Undefined symbol: PyExc_ValueError

More
03 Dec 2024 01:12 #315846 by Grew
I am cross posting this from the Lazarus forum as well.  If there is any light that can be put on the subject it will be very much appreciated.

I have inherited an old but essential app that connected from lazarus to LinuxCNC through PythonForLazarus.  The older version has been running on python 2.7 for many years.  Owing to the need to software upgrade I am trying to reconfigure to newer installation.  So I am at this point:-

- I can use CLI to connect to linuxCNC and have no problems. 

- Demo Python packages from LinuxCNC run with no problem.

- A test application set up in lazarus using python4lazarus as per the video on Youtube by Al As works exactly as expected.

So it seem that the configurations from both sides are correct, however as soon as I enter the python command "import linuxcnc" I get the PyExc_ValueError.  (I do not get any error for this in the CLI)

OS Debian12  installed from linuxCNC's live distro with PreemptRT.
Lazarus 3.4 and FPC 3.2  as installed with fpcupdeluxe.
Python 3.11 ( required for linuxCNC?)

I did an environment comparison between the CLI and Python4Lazarus setups.  The results show only that Python4Lazarus did not have the Pythonpath set.  I added that to the Pythonengine property, but to no avail. ( I attempted a few other methods as well)

  PythonEngine1.PythonPath := '/usr/lib/python3/dist-packages';

I have spent two day solid fighting with this. I am not an experienced programmer so I have probably overlooked something obvious. (please be patient) I have trawled the forums and run all the AI's dry.   I urgently need assistance:(

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

More
14 Dec 2024 18:45 #316666 by andypugh
Did you get to the bottom of this?
My initial feeling is that the two apps might be using different Pythons, which may exist in different codespaces on the PC.

LinuxCNC pretty much only runs with Python3 now, is your Lazarus code running on Python3?

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

Time to create page: 0.081 seconds
Powered by Kunena Forum