Bug 399100 - Make it possible to install packages via pip
Summary: Make it possible to install packages via pip
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-26 11:16 UTC by Larpon
Modified: 2018-09-26 21:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 :-)