Is it possible to import the python freecad library from an appimage?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
dcapeletti
Posts: 504
Joined: Wed Jul 23, 2014 2:27 pm

Is it possible to import the python freecad library from an appimage?

Post by dcapeletti »

Hi, I usually have updated freecad on my system through an appimage, but I don't have it installed on my debian gnu linux system.

I would like to know if it is possible to import the freecad library in the python console of my system to test other applications that I am building without having to install freecad on my system.

Thanks
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Is it possible to import the python freecad library from an appimage?

Post by looo »

Before anyone else posts some hacks to do so: no the appimage is not designed for the usage within an other environment.

But the appimage currently is created with conda. So creating an environment with conda you should be able to install any additional library into the same env as freecad is installed (and also use freecad from python directly)
You can also create an appimage (locally) with additional libraries if you want to distribute a 3rd party module/workbench ... .

For further information please have a look at this script:

https://github.com/FreeCAD/FreeCAD-AppI ... _bundle.sh

If you create an environment with the highlighted command you will get all the libraries that are also installed in the appimage.


edit: update link
Last edited by looo on Tue Feb 09, 2021 9:56 am, edited 2 times in total.
User avatar
mnesarco
Posts: 475
Joined: Thu Mar 26, 2020 8:52 pm

Re: Is it possible to import the python freecad library from an appimage?

Post by mnesarco »

looo wrote: Sat Nov 30, 2019 1:55 pm For further information please have a look at this script:

https://github.com/FreeCAD/FreeCAD-AppI ... v.sh#L2L10

If you create an environment with the highlighted command you will get all the libraries that are also installed in the appimage.
Hi looo, the link is broken. Is is replaced by https://github.com/FreeCAD/FreeCAD-AppI ... _bundle.sh ?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Is it possible to import the python freecad library from an appimage?

Post by looo »

mnesarco wrote: Mon Feb 08, 2021 2:04 am
looo wrote: Sat Nov 30, 2019 1:55 pm For further information please have a look at this script:

https://github.com/FreeCAD/FreeCAD-AppI ... v.sh#L2L10

If you create an environment with the highlighted command you will get all the libraries that are also installed in the appimage.
Hi looo, the link is broken. Is is replaced by https://github.com/FreeCAD/FreeCAD-AppI ... _bundle.sh ?
yes exactly. I have changed the link in the previous post.
User avatar
mnesarco
Posts: 475
Joined: Thu Mar 26, 2020 8:52 pm

Re: Is it possible to import the python freecad library from an appimage?

Post by mnesarco »

looo wrote: Sat Nov 30, 2019 1:55 pm ...
Hi looo, what I need is something different. As a User, I prefer to use AppImages all the time. But it is normal that the AppImage does not contain some python packages. The problem is that I cannot just install the missing packages because the AppImage will not use any system installed package.

What I do and works sometimes is to download the desired package and add its folder to sys.path

Code: Select all

(sys.path.insert(0, path))
But it only works with dependecy free packages or if the dependencies are already available in the AppImage.

I wonder if is it possible to create a conda environment and add its root to sys.path, but I suspect that it will create a lot of conflicts.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Is it possible to import the python freecad library from an appimage?

Post by looo »

mnesarco wrote: Tue Feb 09, 2021 2:32 pm I wonder if is it possible to create a conda environment and add its root to sys.path, but I suspect that it will create a lot of conflicts.
YesI think this is not easy. Best to ask @ conda-forge gitter. But I guess there is no clean solution.
Post Reply