[Solved] Build fail, python version

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Build fail, python version

Post by drmacro »

My real question was, why might the value be set to something other than 3.9 on this machine...and why was it set to a value that worked 2 days ago, and why is it defined on a system so that this is picked up cmake (if cmake is picking it up from the system). If it is the system, what is wrong with the Python setup. (When I type python at the command line it finds 3.9)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
chennes
Veteran
Posts: 3877
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Build fail, python version

Post by chennes »

Those questions are much more mysterious -- the only thing that changed (in that regard) recently is the required version string going up to the new standard. As for how/why it is "finding" a version of Python that met the old standard, but not the new, on a system without that version, I don't know. To eliminate any possible conflicts from within FreeCAD as possible sources of error, maybe we could create a stripped down cMake script you can run on your system to get just the output of

Code: Select all

find_package (Python COMPONENTS Interpreter)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Build fail, python version

Post by adrianinsaval »

debian's versions of python are a huge PITA...
user1234
Veteran
Posts: 3328
Joined: Mon Jul 11, 2016 5:08 pm

Re: Build fail, python version

Post by user1234 »

drmacro wrote: Wed Jan 25, 2023 7:09 pm The I added the same entries as you show. I verified the dir and lib were there. Same error, looking for 3.8.
I am still sure, that you have some remain anywhere. When you add in the line, does it occur? Have you looked in the synaptic package manger, have you done apt-get autoremove (and apt-get autoclean)?

Just as note, can happen, that cmake config can be faulty when it changes by its source after too much changes. Time to time it is good to make a complete new build from scratch. Also i would add -DFREECAD_BUILD_DEBIAN = 1 , -DFREECAD_USE_PYBIND11 = 1 .


adrianinsaval wrote: Wed Jan 25, 2023 8:32 pm debian's versions of python are a huge PITA...
So far no problem on Debian 11 (generally Debian 11 is stable af). The former version with the change from python2 to python3 was sometimes bumpy for me, but i am not an expert, just a user.


Greetings
user1234
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Build fail, python version

Post by drmacro »

user1234 wrote: Thu Jan 26, 2023 12:09 am ...
I am still sure, that you have some remain anywhere. When you add in the line, does it occur? Have you looked in the synaptic package manger, have you done apt-get autoremove (and apt-get autoclean)?

Just as note, can happen, that cmake config can be faulty when it changes by its source after too much changes. Time to time it is good to make a complete new build from scratch. Also i would add -DFREECAD_BUILD_DEBIAN = 1 , -DFREECAD_USE_PYBIND11 = 1 .
I can find no hint of anything but the python 3.9 on this system.

Adding FREECAD_BUILD_DEBIAN and FREECAD_USE_PYBIND11 changed nothing.
...
So far no problem on Debian 11 (generally Debian 11 is stable af). The former version with the change from python2 to python3 was sometimes bumpy for me, but i am not an expert, just a user.

...
And that is my issue here. This Debian 11 machine has built FreeCAD with a daily git pull daily for the last year. No issues with python. With none of the extra make directives discussed so far. Until the git pull included the new test code for python 3.8 or greater.

The question is what does cmake want that it is not finding? I have a second Debian 11 machine, with what appears to be the same python3.9 installation. I use the same bash script on both machines. It has for months worked fine, with no special consideration for python on both machines. Now on one it doesn't work.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Build fail, python version

Post by drmacro »

@user1234 @chennes

Well, I am befuddled. And, embarrassed. :oops:

As I've said, build on this machine has worked for months. And, I could not find version of Python other than 3.9...that is in all places I expected to find Python.

There was a version of 3.7m in /usr/local/bin. No clue how that got there.

Obviously the build had been proceeding fine with finding that, until check for 3.8 or greater was added...

Should have started with a system wide "find".

Sorry for wasting the bandwidth. :oops:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
chennes
Veteran
Posts: 3877
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Build fail, python version

Post by chennes »

I'm just glad you solved it, I was running out of ideas!
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
user1234
Veteran
Posts: 3328
Joined: Mon Jul 11, 2016 5:08 pm

Re: [Solved] Build fail, python version

Post by user1234 »

I could not care less, as long it works.

But have 2 concerns.

- Why does it not work when you define python3.8? Even when an older is installed, it should work anyway.
- If you have not installed python3.7, why is a binary on the system? Have you added/deleted/modified some files per hand with root rights in the system?


Greetings
user1234
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: [Solved] Build fail, python version

Post by drmacro »

user1234 wrote: Fri Jan 27, 2023 4:56 am I could not care less, as long it works.

But have 2 concerns.

- Why does it not work when you define python3.8? Even when an older is installed, it should work anyway.
Do you mean when the make directive specified? This is a good question. I would have expected that to override, but I suspect the new merged check doesn't take the directive into account?
- If you have not installed python3.7, why is a binary on the system? Have you added/deleted/modified some files per hand with root rights in the system?
...
TBH, after finding it, my recollection of why it is was there is not clear. I think at one point I was trying to get a version of FreeCAD and Blender who's Python major/minor rev matched so Sverchok nodes would work. Why it would have been partially un-installed is also un-clear. Since both FreeCAD and Blender have moved to 3.8 or greater.

I have removed all traces of 3.7 (I think) and nothing has broken so far. :roll:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
chennes
Veteran
Posts: 3877
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: [Solved] Build fail, python version

Post by chennes »

drmacro wrote: Fri Jan 27, 2023 1:06 pm Do you mean when the make directive specified? This is a good question. I would have expected that to override, but I suspect the new merged check doesn't take the directive into account?
The recent tweaks to cMake should move the Python detection to use the standardized find_package architecture. To set the Python location manually, you should set "Python_ROOT_DIR" to the path to your Python installation.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply