Bug 399100

Summary: Make it possible to install packages via pip
Product: [Applications] krita Reporter: Larpon <lp>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: halla
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Larpon 2018-09-26 11:16:30 UTC
I'd be nice with a way to install packages on-demand from with-in scripts.

Like this

--------------------
import pip

def install(package):
    if hasattr(pip, 'main'):
        pip.main(['install', package])
    else:
        pip._internal.main(['install', package])

...

install('pillow')
--------------------

Running this code via scripter fails with:
**********************
locale.Error: unsupported locale setting

In file: /tmp/.mount_krita-ymDKuy/usr/lib/python3.5/locale.py
In function: setlocale at line: 594. Line with error:
return _setlocale(category, locale)
**********************
Comment 1 Halla Rempt 2018-09-26 12:12:57 UTC
No, that's not going to work with appimages, ever: appimages are read-only, so the python home is not writable.
Comment 2 Larpon 2018-09-26 20:55:48 UTC
You are right, I completely overlooked that - sorry.
As you know I found a way to patch appimages by re-packing them on Linux instead.
Comment 3 Halla Rempt 2018-09-26 21:33:53 UTC
Which is cool :-)