Jacotheron / FlashForge-CreatorPro2-PS-Profile

PrusaSlicer Profile for the FlashForge CreatorPro2 3D printer
22 stars 7 forks source link

automatically install Pillow dependancy for currently running python instance (non flatpak only) #16

Open y-e-r opened 10 months ago

y-e-r commented 10 months ago

I had some trouble with git... may want to squash the 6 commits with "squash and merge" option in github. but anyway:

added a simple snippet to automatically install Pillow for whatever version of python and whatever python environment is currently running. this is useful as most people have multiple python installs on their system. also this simplifies the profile installation.

It doesn't work for flatpak (linux) as the flatpak version of python does not come with the ability to install modules (pip). this can be remedied by manually adding pip to flatpak's python instance, but its kinda hacky: tested on Fedora39 and PrusaSlicer-2.7.1+flathub.org

sudo dnf install -y python3.11
/usr/bin/python3.11 -m pip install --upgrade --user pip
sudo cp -R /home/$USER/.local/lib/python3.11/site-packages/pip /home/yer/.var/app/com.prusa3d.PrusaSlicer/data/python/lib/python3.11/site-packages/

and then running the flash print profile I'll work on a better solution and if you accept this pull request I will update the readme to reflect my changes. thanks.