PDA

View Full Version : [HowTo] python plugins and GIMP with Windows



Sagenlicht
10-02-2008, 07:10 AM
Hmm as it seems that some people got some problems to use python plugins with GIMP with windows I'll provide a short HowTo.

What do you need?
- Download and install Python. GIMP doesnt work with Python 3 nor with the latest Python 2 release (2.7). You need to download Python 2.6.6 *Link to source (http://www.python.org/download/releases/2.6.6/)* - grab the MSI Windows Installer you need - either 32 or 64 bit version.

- Now you need install the PyGTK package. There is a complete all-in-one installer avaible at the project page. *Link to source (http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/)* - grab the pygtk-all-in-one-2.24.0.win32-py2.6.msi file.

Afterwards reinstall GIMP and be sure to do either a full installation or a custom installation with activated Python elements. If the GIMP installer did grey out the python elements at least one of the above programs aint correctly installed.

Now GIMP is ready to use python plugins. In order to use them you just have to copy them into your plugin folder, which is normally located at C:\Documents and Settings\<Your windows user>\gimp-2.4\plug-ins. If it aint there you can check in GIMP where your custom plugins folder is located at.

I hope this short HowTo helps :)

EDIT: I updated the links.

Karro
10-02-2008, 04:53 PM
A quick question... what will reinstalling GIMP do to my existing Script-fu plugins and custom brushes? Will I need to reinstall them as well?

Sagenlicht
10-02-2008, 05:55 PM
As long as they are stored in your custom folders (in documents and settings if you use the default settings) you dont have to worry about them.

stuamn
10-02-2008, 07:34 PM
I installed python from the above link - it's version 2.6. pyGTK+, pyCairo and pyGobthingy seem to need Python 2.5. Not sure at the moment whether to uninstall 2.6 and install 2.5 or wait for updates to the three pys.

GIMP 2.6 is out so i'll have a play with that before deciding

Sagenlicht
10-03-2008, 06:29 AM
Hi Stuamn,

yep Python recently released 2.6 though if you scroll down a bit you'll find the link to 2.5.2 which is the version I would recommend at the moment.

Python 2.6 doesnt offer anything you need for GIMP, in fact the 2.6 release just prepares Python for its next major release (3.0). So if you plan to use python mainly for GIMP I would recommend to downgrade to version 2.5.2.

stuamn
10-03-2008, 09:23 AM
Thanks, It works now. I uninstalled everything before starting. Gimp, GTK and python 2.6. Then I installed as per your instructions. I would rep you but it seems that I have already done so recently. I'll spread some about and rep you next time I see your name ;)

stuamn

Karro
02-23-2009, 06:23 PM
Okay, so I finally found time to get around to trying to install Python so I can use the python scripts in GIMP. (Until now, I'd just accumulated a bunch of scripts in my downloads folder.)

So... apparently I ran into a problem. I installed Python, no problem, I now have Python on my system. It's not Python 2.5.2, but 2.5.4, as that was the only 2.5-level version available on that site.

Then I installed gtk+. When I went to the runtime link, it sent me to a place where I downloaded gtk-2.12.9-win32-1. So I installed that.

Next for the other three, PyCairo, PyGTK, and PyGObject.

There were several selections available here, some ending with a file name descriptor of py2.6 and some with a descriptor of py2.5. I went with the 2.5 versions.

When I installed each of these, I got a succession of three error messages. I didn't keep an accurate note of what these errors were. It was the same three for each item, and started with a "could not create... yada yada yada".

I clicked "OK" through the errors, and it completed the install. Apparently, not really, though, it just told me it did.

So, I have a few python scripts now sitting in my GIMP Scripts folder (same place as all the scm files that are showing just fine), but I can find none of the scripts. I'm guessing... something went wrong with the install. I had reinstalled GIMP as directed, and it did not have the Python options greyed-out, so I assumed that despite the three error messages mentioned above, maybe everything was alright. But alas, it is not.

So... What do you think I did wrong? I'm guessing the problem must have been with the GTK+... but I'm not sure.

jfrazierjr
02-23-2009, 06:28 PM
Okay, so I finally found time to get around to trying to install Python so I can use the python scripts in GIMP. (Until now, I'd just accumulated a bunch of scripts in my downloads folder.)

So... apparently I ran into a problem. I installed Python, no problem, I now have Python on my system. It's not Python 2.5.2, but 2.5.4, as that was the only 2.5-level version available on that site.

Then I installed gtk+. When I went to the runtime link, it sent me to a place where I downloaded gtk-2.12.9-win32-1. So I installed that.

Next for the other three, PyCairo, PyGTK, and PyGObject.

There were several selections available here, some ending with a file name descriptor of py2.6 and some with a descriptor of py2.5. I went with the 2.5 versions.

When I installed each of these, I got a succession of three error messages. I didn't keep an accurate note of what these errors were. It was the same three for each item, and started with a "could not create... yada yada yada".

I clicked "OK" through the errors, and it completed the install. Apparently, not really, though, it just told me it did.

So, I have a few python scripts now sitting in my GIMP Scripts folder (same place as all the scm files that are showing just fine), but I can find none of the scripts. I'm guessing... something went wrong with the install. I had reinstalled GIMP as directed, and it did not have the Python options greyed-out, so I assumed that despite the three error messages mentioned above, maybe everything was alright. But alas, it is not.

So... What do you think I did wrong? I'm guessing the problem must have been with the GTK+... but I'm not sure.


The most important thing I found was you have to reboot after installing Python before you install anything else. Worst case scenario, install something without errors in the order listed and reboot before trying the next thing.

RobA
02-23-2009, 09:47 PM
Also, python scripts actually are plugins, and have to be in the plugins folder, not the scripts folder (cause script-fu/tiny-fu is actually a plugin... Confusing, I know)...

-Rob A>

Vandy
02-24-2009, 10:22 AM
Hello, All.

I have a general question for you. I noticed when I installed Inkscape that Python files were installed as well.

Is there anything I need to be concerned with before installing the Python files needed for GIMP or are the Python files installed with Inkscape okay or, what?

Thanks.

Regards,

Gary

Karro
02-24-2009, 11:20 AM
The most important thing I found was you have to reboot after installing Python before you install anything else. Worst case scenario, install something without errors in the order listed and reboot before trying the next thing.

I did indeed restart after installing Python. The exact order I took was:

1) Uninstall GIMP
2) Download all the Python and GTK+ and Py-stuff
3) Install Python 2.5.4
4) Restart
5) Install GTK+
6) Install other Py-stuff
7) Make sure that shiny new scripts are all all in the script folder of GIMP
8) Reinstall (latest version of) GIMP [note: I had been running GIMP 2.4, upgraded to 2.6.5; I don't think I like that you can't minimize the tools and layers/palette windows anymore... sometimes I want to access my desktop, you know? I think I do like that it automatically opens a window for an image frame with all the menus centralized]


Also, python scripts actually are plugins, and have to be in the plugins folder, not the scripts folder (cause script-fu/tiny-fu is actually a plugin... Confusing, I know)...

-Rob A>

Ahh. Somewhere along the way I had gotten the impression that Python scripts belonged in the script folder along with script-fu scripts. I'll change them around tonight and check and see if that solves the problem, thanks!


Note: It changes my 8parenthesis into a bespectacled smiley; I'm just trying to enumerate, not to be cool 8) ;)

jfrazierjr
02-24-2009, 11:53 AM
I did indeed restart after installing Python. The exact order I took was:

1) Uninstall GIMP
2) Download all the Python and GTK+ and Py-stuff
3) Install Python 2.5.4
4) Restart
5) Install GTK+
6) Install other Py-stuff
7) Make sure that shiny new scripts are all all in the script folder of GIMP
8) Reinstall (latest version of) GIMP [note: I had been running GIMP 2.4, upgraded to 2.6.5; I don't think I like that you can't minimize the tools and layers/palette windows anymore... sometimes I want to access my desktop, you know? I think I do like that it automatically opens a window for an image frame with all the menus centralized]



Ahh. Somewhere along the way I had gotten the impression that Python scripts belonged in the script folder along with script-fu scripts. I'll change them around tonight and check and see if that solves the problem, thanks!


Note: It changes my 8parenthesis into a bespectacled smiley; I'm just trying to enumerate, not to be cool 8) ;)

Install GTK, reboot.
Install all the other python stuff, reboot
Install GIMP and check the python option during the install.

I had trouble with this also, and originally blamed it on being Vista 64 bit after getting my new computer. For a few weeks, I was just bummed. I then went back to it and did several reboots between and got it working.

Karro
02-24-2009, 12:26 PM
Install GTK, reboot.
Install all the other python stuff, reboot
Install GIMP and check the python option during the install.

I had trouble with this also, and originally blamed it on being Vista 64 bit after getting my new computer. For a few weeks, I was just bummed. I then went back to it and did several reboots between and got it working.

If RobA's suggestion doesn't work, I'll move on to trying the "reboot after each step" philosophy. Don't know if I'll have time to work on this tonight or not. Usually don't have time once I'm home with my wife, as either I have to study or spend time with her.

RobA
02-24-2009, 04:16 PM
Also, the inkscape python install is specific to inkscape, so it won't interfere with any other python install on your system.

-Rob A>

Karro
02-25-2009, 09:34 AM
Well, had a few minutes (about 15 minutes of contiguous free time) last night, and it looks like this is a case of 6 in one hand, half-dozen in the other.

I only had time to try moving the Py scripts into the Plugins folder, as RobA suggested. Upon starting up GIMP, I found that GIMP now recognized the Py scripts, insofar as the scripts were now listed in the menus.

However, upon trying to run one, I got an error message, first "Something something could not find something something". Okay, so, it's probably not going to work. Click OK, and a second error message pops up saying the Py Script has crashed and has been terminated.

Looks like I'm going to have to go back, as Joe suggested, and after each install do a reboot. I hope that works, but assuming it doesn't, any other suggestions on what I might have done wrong?

jfrazierjr
02-25-2009, 12:43 PM
Another thing, make sure you uninstall GIMP before starting, just in case you skipped that step and tried to install GIMP over top of an existing install..

Karro
02-25-2009, 02:09 PM
Another thing, make sure you uninstall GIMP before starting, just in case you skipped that step and tried to install GIMP over top of an existing install..

Thanks. Yeah, I did uninstall, first. I guess I'll do so again when I try to reinstall all the python elements.

Karro
02-25-2009, 06:03 PM
Well, no dice.

I just uninstalled GIMP, then uninstalled GTK, just in case.

I ran the install on GTK - the exact file I ran was "gtk-2.12.9-win32-1". It went fine as before. No errors that I could see.

Then I reboot my laptop.

Next, I attempted to install PyCairo.

I got the same three error messages. This time I recorded them:

1.
title: Could not create
message: pycairo-py2.5
I clicked "OK" (no other options)

2.
title: Could not set key value
message: Python 2.5 pycairo-1.4.12
I clicked "OK" (no other options)

3.
title: Could not set key value
message: "C:\Python25\Removpycairo.exe" -u "C:\Python25\pycairo-wininst.log"
Again, clicked "OK" (no other options)

And... finally it pretends to finish installing, and voila, I click "FINISH".

In the C:\Python25 folder, under "Lib\site-packages" (the default directory for the PyCairo install) there is now a Cairo folder, within which we find three files named "_init_" (one a python file and the other two "compiled" python files) as well as _cairo.pyd. In the former directory there is also a file called "pycairo-1.4.12-py2.5.egg-info". There are also several pygtk files and a gtk-2.0 folder. (I don't know if the pygtk files are left over from the previous install, but I suspect that has nothing to do with the current error.) Given these errors, I didn't bother trying to install pygtk or pygobject.

So... any chance you guys think a functional install of Python for GIMP will be included in future GIMP versions? Also... does any of this make sense to anybody? I guess I just don't get to use python scripts in my GIMP...

Another question: What the heck are each of these supposed to do? And why are they required to make GIMP python scripts useable? I've enjoyed using GIMP for sure (and you can't beat the price) but it's certainly doomed to be relegated to a very narrow niche-status if it's this difficult to get the full benefit of GIMP's python script functionality.

jfrazierjr
02-25-2009, 06:51 PM
Well, no dice.

I just uninstalled GIMP, then uninstalled GTK, just in case.

I ran the install on GTK - the exact file I ran was "gtk-2.12.9-win32-1". It went fine as before. No errors that I could see.

Then I reboot my laptop.

Next, I attempted to install PyCairo.

I got the same three error messages. This time I recorded them:

1.
title: Could not create
message: pycairo-py2.5
I clicked "OK" (no other options)

2.
title: Could not set key value
message: Python 2.5 pycairo-1.4.12
I clicked "OK" (no other options)

3.
title: Could not set key value
message: "C:\Python25\Removpycairo.exe" -u "C:\Python25\pycairo-wininst.log"
Again, clicked "OK" (no other options)

And... finally it pretends to finish installing, and voila, I click "FINISH".

In the C:\Python25 folder, under "Lib\site-packages" (the default directory for the PyCairo install) there is now a Cairo folder, within which we find three files named "_init_" (one a python file and the other two "compiled" python files) as well as _cairo.pyd. In the former directory there is also a file called "pycairo-1.4.12-py2.5.egg-info". There are also several pygtk files and a gtk-2.0 folder. (I don't know if the pygtk files are left over from the previous install, but I suspect that has nothing to do with the current error.) Given these errors, I didn't bother trying to install pygtk or pygobject.

So... any chance you guys think a functional install of Python for GIMP will be included in future GIMP versions? Also... does any of this make sense to anybody? I guess I just don't get to use python scripts in my GIMP...

Another question: What the heck are each of these supposed to do? And why are they required to make GIMP python scripts useable? I've enjoyed using GIMP for sure (and you can't beat the price) but it's certainly doomed to be relegated to a very narrow niche-status if it's this difficult to get the full benefit of GIMP's python script functionality.

They are things related to pythons graphics manipulation libraries IIRC. Why undoing all of it, INCLUDING Python...
Reboot after you have uninstalled everything (at the end) and then follow the instructions and reboot after installing each component. I know it is critical to reboot after install Python because most times, the OS environment does not get set up correctly until after the reboot to "know" Python is there.

Here is what I think I did.

Install Python
Reboot
Install GTK
Reboot
Install the 3 libraries
Reboot
Install Gimp, if possible, uncheck the option to install GTK(so it does not install over the possibly newer one.)

Karro
02-25-2009, 11:33 PM
They are things related to pythons graphics manipulation libraries IIRC. Why undoing all of it, INCLUDING Python...
Reboot after you have uninstalled everything (at the end) and then follow the instructions and reboot after installing each component. I know it is critical to reboot after install Python because most times, the OS environment does not get set up correctly until after the reboot to "know" Python is there.

Here is what I think I did.

Install Python
Reboot
Install GTK
Reboot
Install the 3 libraries
Reboot
Install Gimp, if possible, uncheck the option to install GTK(so it does not install over the possibly newer one.)

Success.... I think.

I still got the three error messages. But I guess that's not the problem. You clued me in with the "uncheck the option to install GTK". I realized that GIMP was installing a version of GTK over what I'd already installed. I think that might have been messing up the Python libraries.

However... the version that GIMP installs is a newer (and apparently better looking, this older GTK 2.12.9 is pretty ugly compared to the GTK 2.14.7, which is what I think GIMP comes with) version of GTK... so now I have to do it all over again but installing that newer GTK first. I found the newer version, so I'll go ahead and do that next.

Whew... this was tougher than I expected! Glad I finally got it to work. There's some neat stuff being written in Python! Anyway, one more round we go...

RobA
02-26-2009, 07:20 AM
I know it is late in this thread, but I installed using this pack assembled by photocomix over at gimptalk:
http://photocomix-resources.deviantart.com/art/Gimp-Python-support-easier-74889017

It is one bundle with all all the compatible version installs and a step by step guide...

-Rob A>

Karro
02-26-2009, 09:04 AM
I know it is late in this thread, but I installed using this pack assembled by photocomix over at gimptalk:
http://photocomix-resources.deviantart.com/art/Gimp-Python-support-easier-74889017

It is one bundle with all all the compatible version installs and a step by step guide...

-Rob A>

Yeah, I just found the same pack last night. Although, upon deeper examination, the items included are the same versions I pulled down from Sagenlicht's links, but at least here it's all already together.

The only (minor) problem is that the GTK+ included is, I think, very out of date (the others don't appear to be so much).

But, I'm second-guessing my conclusion that GIMP's more current GTK+ installing over the older GTK+ is the source of the problem. I'd have to do some testing to see for sure, but I began to suspect last night that part of the problem was that I chose a poor test-case of a python add-in to verify whether python for GIMP was working. I discovered later last night that Sagenlicht's GURM, which I had been using as a quick test, requires some additional hacking in the .py and .ini files to make work... Still haven't gotten that one script working, but all the others I've downloaded so far are now working like a charm!

Thanks everybody for your patience with this guy who "knows just enough about computers to be dangerous, but not enough to be useful".

RobA
02-26-2009, 09:15 AM
The simplest test is the render>clouds>fog as it is afaik bundled with gimp.

-Rob A>

x0brandi
06-03-2009, 12:55 AM
I found the forum for GURM through many Google searches.
Downloaded it.Installed it.
& it didn't show up in my filters folder in Gimp.
Looked around & found this thread.
I tried downloading Python 2.5.4 since 2.5.2 isn't there. It wouldn't install correctly. I went ahead & Googled Python 2.5.2 & download it instead. After this, I deleted gimp.
I tried going back to gimp.org & downloading it, but it gave me an error message, something to the extent of not complete file. Then I tried quite a few mirrors, no luck. I tried deleting the Python, PyCairo, PyGObject and PyGTK. I did a system restore & got Gimp back, but it was 2.4 & was missing some files, i.e. no menu bars. I finally got Gimp to download, but still can't get this plug-in to work. I know this may seem like a bunch of useless information, but i wanted to make sure all my steps were taken into account if necessary, plus my memory is pretty bad. Any help would be greatly appreciated. By the way, everything else seemed to download correctly.

Doc_Waldo
12-06-2010, 04:16 AM
Does anyone know how to install this plugin on a mac?

--Doc

Notsonoble
08-04-2011, 11:37 AM
Has anybody checked to make sure this all works with updated python 2.7.2 and gimp 2.6.11?

jfrazierjr
08-04-2011, 11:39 AM
Many non Core plugins are messed up in 2.7 since the API is changed. I am using 2.7.2 on linux and miss it a lot.

Notsonoble
08-04-2011, 01:23 PM
Yeah, and I just found GIMP for windows can't even see python 2.7, found a 2.6.6 installer to try.

Sagenlicht
08-04-2011, 02:26 PM
I updated all links in the first post.

Sagenlicht
08-04-2011, 02:29 PM
Has anybody checked to make sure this all works with updated python 2.7.2 and gimp 2.6.11?
GIMP requires Python 2.6 or Python 2.5

When Python 2.6 came out it did take some time till GIMP supported that as well, so that aint a surprise Python 2.7 aint supported yet. I doubt Python 2.7. will be supported in GIM 2.6 at all.