ppd / freecad-ppd

5 stars 1 forks source link

Updating to python 3.9 so we can match Blender's python version? #30

Closed luzpaz closed 2 years ago

luzpaz commented 2 years ago

Hey @ppd there is an issue with blender interoperability that is due to conflicting python versions. See https://github.com/nortikin/sverchok/issues/4005

The AppImage is currently using 3.9.12

OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28567 (Git) AppImage
Build type: Release
Branch: (HEAD detached at eb65256)
Hash: eb652569c1bc905b9ece89598ce99e2a2549acae
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)

Is this something we can consider for Snap edge ?

ppd commented 2 years ago

We're using the default python version in the core20 snap, python 3.8. When we switch to core22 (based on 22.04), we'll get python 3.10.

ppd commented 2 years ago

But from a first glance at sverchok, it seems to be a Blender plugin that loads the FreeCAD python bindings. In that case, this seems irrelevant for the snap because snaps are self-contained. This would only be necessary if we shipped Blender itself in our snap. Please correct me if I'm wrong.

luzpaz commented 2 years ago

Why irrelevant? If the self-contained environment of a snap has an incompatible python version with whatever blender version installed on the system, then there is a problem... right?

CC @HaasNL2 (just wanted to give you heads up that this discussion is also going on)

Edit: clarification

luzpaz commented 2 years ago

Screenshot_20220403_155552

ppd commented 2 years ago

If the self-contained environment of a snap has an incompatible python version with whatever blender version installed on the system, then there is a problem... right?

Well, Blender does not use the snap's (freecad-ppd's) libraries or python environment. If you install Blender on the host, it will use the host's python libraries and modules. If you install a Blender snap, it will use that snap's environment.

MisterMakerNL commented 2 years ago

Thanks for tagging me, I am having a blast with Sverchok linked with Freecad! Don't understand why not more are using it. About the Python support, I would say support the LTS (Long Term Support) version that is why I think they made that version so you got a stable working version, and it won't change every month. Something that really would benefit user experience. Also as long as Freecad can work with Blender 2.8 or higher it will be fine most of the time. If we have to go lower than 2.8 which was the case couple months ago then we run into issues with plugins not working and other things.

ppd commented 2 years ago

I'll summarize the confusion:

  1. Blender loads Sverchok, which is a python module
  2. Sverchok loads the FreeCAD bindings from the environment in which Sverchok itself is running. For native installations, this is the FreeCAD installation somewhere in /usr.
  3. The AppImage's and Snap's python environments are confined and separate from the system's environment. Sverchok would never access these environments, and it also shouldn't attempt to because the libraries in these environments are linked against the snap's libraries, which does not allow mixing them freely with the host system's libraries (you could argue that this is 90% of the point of snap and AppImages in general).

Therefore, it does not matter what python env we use in the snap.