# Mapping Resources > Tutorials/How-To >  [HowTo] python plugins and GIMP with Windows

## Sagenlicht

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** - 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** - 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  :Smile: 

EDIT: I updated the links.

----------


## Karro

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

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

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

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

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  :Wink: 

stuamn

----------


## Karro

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

> 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.
> ...



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

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

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

> 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
 :Cool:  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  :Cool:   :Wink:

----------


## jfrazierjr

> 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
> ...


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

> 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

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

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

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

> 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

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

> 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.
> ...


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

> 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
> ...


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

I know it is late in this thread, but I installed using this pack assembled by photocomix over at gimptalk:
http://photocomix-resources.devianta...asier-74889017

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

-Rob A>

----------


## Karro

> I know it is late in this thread, but I installed using this pack assembled by photocomix over at gimptalk:
> http://photocomix-resources.devianta...asier-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

The simplest test is the render>clouds>fog as it is afaik bundled with gimp. 

-Rob A>

----------


## x0brandi

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

Does anyone know how to install this plugin on a mac?  

--Doc

----------


## Notsonoble

Has anybody checked to make sure this all works with updated python 2.7.2 and gimp 2.6.11?

----------


## jfrazierjr

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

Yeah, and I just found GIMP for windows can't even see python 2.7, found a 2.6.6 installer to try.

----------


## Sagenlicht

I updated all links in the first post.

----------


## Sagenlicht

> 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.

----------

