Gimp, python, and numpy - 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: Gimp, python, and numpy (/Thread-Gimp-python-and-numpy) |
RE: Gimp, python, and numpy - Zero01 - 12-07-2017 All of a sudden there seemed to be NEW IMPROVED possibility of something working thanks to Kevin! 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' RE: Gimp, python, and numpy - Kevin - 12-07-2017 @Zero01 The problem looks like you don't have permission to create a directory: Code: mkdir(name, mode) I suggest trying it again, but run the Windows Command Prompt window as Administrator: [attachment=1065] RE: Gimp, python, and numpy - Zero01 - 12-07-2017 (12-07-2017, 05:33 PM)Kevin Wrote: @Zero01Fantastic - 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. [attachment=1066] RE: Gimp, python, and numpy - Ofnuts - 12-07-2017 "Python-Fu > Console" was just a way to check that everything is working. RE: Gimp, python, and numpy - Zero01 - 12-07-2017 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? RE: Gimp, python, and numpy - Ofnuts - 12-07-2017 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... RE: Gimp, python, and numpy - rich2005 - 12-07-2017 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. RE: Gimp, python, and numpy - rich2005 - 12-08-2017 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 [attachment=1070] Works here [attachment=1071] A zipped archive of the files here: https://my.pcloud.com/publink/show?code=XZnkyJ7ZoJtOQgL9TB7FX3JBgNIQguBvH67y 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 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. RE: Gimp, python, and numpy - Zero01 - 12-10-2017 (12-08-2017, 11:08 AM)rich2005 Wrote: Anyone want to try this? .. 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 : screenshot of it working in Vista 32 VM [attachment=1078] |