+ 1

using python in free wing ide to import images

i would like to import some images to my program im writing in a free version of wing ide on a windows 10 computer my question is this is there a way to do this if so what format do the images need to be in?

11th Dec 2017, 9:05 PM
David Aseltine
David Aseltine - avatar
20 ответов
+ 6
Oh, you need to invoke this in your operating system's command line, not the Python console. Pip is just an installer so it has to be executed as a normal file. The above goes for *all* modules you might want to "pip install" in the future.
12th Dec 2017, 7:25 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Hmm... I used a simple 'pip install pillow' instruction and it worked like a charm. Just open your Python console and run it. Let me know if you get any errors, we'll solve it ;)
11th Dec 2017, 10:28 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 4
Might be an issue with your PATH setting perhaps. Did you install your Python correctly?
12th Dec 2017, 4:36 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
What exactly do you want to do, display those images to the user? Do you use a particular GUI library?
11th Dec 2017, 9:24 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Alright then, let's break this down. What kind of error do you get? What is your Python version? Does it work if you just enter 'python' in the command line?
12th Dec 2017, 4:45 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Yep, it's most likely the PYTHONPATH thing then. It is an environment variable which has to be set and point to where your Python installation is located. Check out the docs on how to set it properly in Windows: https://docs.python.org/3/using/windows.html
12th Dec 2017, 4:59 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Python is free, forever and ever :) It's most probably the file path setting, you have to set it manually, I think. Check out this instruction set: https://docs.python.org/3/using/windows.html#excursus-setting-environment-variables
12th Dec 2017, 5:56 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
Try pillow module, it handles all sorts of files neatly and easily: https://pillow.readthedocs.io/en/4.3.x/ from PIL import Image im = Image.open('myphoto.jpg') im.show()
11th Dec 2017, 9:44 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
no luck on reinstalling I want to thank you for all your help I'm going to put it off for now it's not needed for my program to run just something I would like to add I will keep working on it and I'll try to find someone I can sit down with and they can help me while looking at the computer itself either way when I do find the answer I will post what was going on I'm sure it's the path too now after doing some reading on it but even after trying the things to fix it I'm still getting no where so maybe I'm doing it wrong I don't but again thank you so much for your help
12th Dec 2017, 6:39 PM
David Aseltine
David Aseltine - avatar
+ 1
I want to display an image to the user
11th Dec 2017, 9:29 PM
David Aseltine
David Aseltine - avatar
+ 1
and I don't use particular GUI library at the moment
11th Dec 2017, 9:32 PM
David Aseltine
David Aseltine - avatar
+ 1
i cant seem to install pillow any advice i have tried the code provided on the link you gave but its not working any advice
11th Dec 2017, 10:13 PM
David Aseltine
David Aseltine - avatar
+ 1
when I try to run pip install pillow I get a Syntex error
12th Dec 2017, 3:46 AM
David Aseltine
David Aseltine - avatar
+ 1
that makes sense thank you
12th Dec 2017, 1:06 PM
David Aseltine
David Aseltine - avatar
+ 1
I've tried running it in the cmd line and also in \ py.exe and I can't get it to work not sure where I need to run this command
12th Dec 2017, 1:47 PM
David Aseltine
David Aseltine - avatar
+ 1
I installed python because I'm taking a college course on it so I just followed their guide lines on how to do it some assuming I did yes
12th Dec 2017, 4:41 PM
David Aseltine
David Aseltine - avatar
+ 1
python v3.6 if I run the install command in cmd prompt the error is pip is not an internal or external command if I type just python same error
12th Dec 2017, 4:50 PM
David Aseltine
David Aseltine - avatar
+ 1
if I enter py.exe it will go that far and then I get an invalid syntax error at the end of the word install
12th Dec 2017, 4:55 PM
David Aseltine
David Aseltine - avatar
+ 1
I'm still not getting anywhere still getting the same errors is it possible that it's because I have the free version of python?
12th Dec 2017, 5:33 PM
David Aseltine
David Aseltine - avatar
+ 1
I'm reinstalling python to see if that helps
12th Dec 2017, 6:10 PM
David Aseltine
David Aseltine - avatar