Gimp-Forum.net
Trouble importing third party Python packages to GIMP 2.10 so that they can be used t - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: Trouble importing third party Python packages to GIMP 2.10 so that they can be used t (/Thread-Trouble-importing-third-party-Python-packages-to-GIMP-2-10-so-that-they-can-be-used-t)



Trouble importing third party Python packages to GIMP 2.10 so that they can be used t - Psyntax - 12-02-2019

My goal is to import a couple third party Python packages for use with my GIMP installation. This will allow me to use these packages when developing a GIMP plugin. I noticed a few directories that may be of use. They are as follows:

C:\Program Files\GIMP 2\32\lib\python2.7

This directory contains a site-packages folder which contains packages such as requests and pip.

C:\Program Files\GIMP 2\32\bin

This directory contains a python.exe. When I run python --version in an elevated cmd at this directory path, the output is Python 2.7.16, which I assume is GIMP 2.10's version of Python. This is important because I have my own installation of Python 3.8.0 in my Program Files. If I'm anywhere outside of this path in the cmd, the version that outputs is 3.8.0.

I have added these directories to my PATH system variable and tried running pip install but the output tells me I have already installed the requested third party packages. The problem is that they are installed to my Python 3.8.0 installation. I'm trying to run pip install in the context of GIMP's Python environment.

Any advice would be much appreciated.


RE: Trouble importing third party Python packages to GIMP 2.10 so that they can be used t - Ofnuts - 12-02-2019

You have to install pip for the Gimp Python run time, which is done by running get-pip.py with the Python interpreter in that runtime.

See https://www.gimp-forum.net/Thread-Gimp-python-and-numpy?pid=4385#pid4385