Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp, python, and numpy
#21
All of a sudden there seemed to be NEW IMPROVED possibility of something working thanks to Kevin! Smile
Still didn't work for me.. got the same error as you dinasset.. then I did a few things and tried the command but the same error appears but cmd goes through the process (needlessly) of collecting and installing pip, setuptools etc (stuff that's already been done) then I get a whole load of red writing that's hard to see that states the following...(sorry for long screed..):
Exception:
Traceback (most recent call last):
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\wheel.py", line 316, in clobber
ensure_dir(destdir)
File "c:\users\marti\appdata\local\temp\tmpylkzs3\pip.zip\pip\utils\__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "C:\Program Files\GIMP 2\Python\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'C:\\Program Files\\GIMP 2\\Python\\Lib\\site-packages\\pip'
Reply
#22
@Zero01

The problem looks like you don't have permission to create a directory:
Code:
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'C:\\Program Files\\GIMP 2\\Python\\Lib\\site-packages\\pip'

I suggest trying it again, but run the Windows Command Prompt window as Administrator:
   
Reply
#23
(12-07-2017, 05:33 PM)Kevin Wrote: @Zero01

The problem looks like you don't have permission to create a directory:
Code:
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'C:\\Program Files\\GIMP 2\\Python\\Lib\\site-packages\\pip'

I suggest trying it again, but run the Windows Command Prompt window as Administrator:
Fantastic - it's working - woohoo!! Thanks a lot - I didn't even have to do the last part (Python-Fu > Console) so it seems... cheers Kevin, dinasset, rich and Ofnuts of course !!! Much obliged.. Windows has some redeeming features so it seems (kind of..). That was a real challenge - I could have easily given up, but the power of python kept me going ..and living my life vicariously through the technical know-how of others! lol nice one.

   

Smile
Reply
#24
"Python-Fu > Console" was just a way to check that everything is working.
Reply
#25
I see, so with Numpy, do you think that could help in the future development of GIMP going forward.. or were you just trying it out for the hell of it?
Reply
#26
This just a good way to write scripts that must compute things on pixels. When you write scripts, either you rely on Gimp operations (your unit of work is the layer, or a selection on a layer) or you work pixel-by-pixel. But since the image can contain several million pixels, this can be slow if you write code loops in Python. With something like numpy you can do math operations on a whole layer at a time or even on several layers. The median filter is a typical example of something that cannot be done with layer blend modes so doing it in a script without numpy it would be very slow.

Of course one can also use GMIC...
Reply
#27
Anyone still having problems, a video demo of the installation thanks to Kevins instructions.

https://youtu.be/wXfUGYb9JTc

I have been a Gimp user long enough to remember Python as a separate installation in Gimp 2.6 and earlier.

I can not see any reason why numpy should not be included in the windows build, It is not that big an installation. Of course in linux Ofnuts script worked out of the box here, any number of packages pull it in as a dependency.

What about the future development of Gimp. The trend seems to be away from small window plugins to GEGL working on the whole canvas, a matter of wait and see.
Reply
#28
Anyone want to try this?

Looking at what was installed, looks like there is more there than required. The numpy folder goes into C:\Users\Appdata

Could this be packaged with Windows? probably

This from the Win7 installation, transferred to Win10

Two files f2py.py and f2py.pyc go in C:\Program Files\GIMP 2\Python and the folder numpy goes in C:\Program Files\Python\Lib

   


Works here

   

A zipped archive of the files here: https://my.pcloud.com/publink/show?code=...IQguBvH67y about 8 MB

Unpacked, the whole thing amounts to about 30 MB, looking at the numpy folder I get the feeling that could be slimmed down. Leave that to the clever guys Wink

What about the Windows Gimp development version, 2.9.x ? That does use a 64 bit python installation and an older version of python - Python 2.7.5 So these files not for you.
Reply
#29
(12-08-2017, 11:08 AM)rich2005 Wrote: Anyone want to try this?

Looking at what was installed, looks like there is more there than required. The numpy folder goes into C:\Users\Appdata

Could this be packaged with Windows? probably

This from the Win7 installation, transferred to Win10

Two files f2py.py and f2py.pyc go in C:\Program Files\GIMP 2\Python and the folder numpy goes in C:\Program Files\Python\Lib




Works here



A zipped archive of the files here: https://my.pcloud.com/publink/show?code=...IQguBvH67y about 8 MB

Unpacked, the whole thing amounts to about 30 MB, looking at the numpy folder I get the feeling that could be slimmed down. Leave that to the clever guys Wink

What about the Windows Gimp development version, 2.9.x ? That does use a 64 bit python installation and an older version of python - Python 2.7.5 So these files not for you.

..
Posted this already, but it seems to have disappeared...

Anyway, I tried your files in a Windows Vista 32-bit VM, works absolutely fine!
Much easier than everything else we tried :Smile

screenshot of it working in Vista 32 VM

   
Reply


Forum Jump: