I have successfully installed PIL/Pillow for python 3.4 but I want it for python 2.7. I thought it might be automatically downloaded for 2.7 as well but when I tried the python shell from the terminal, it keeps saying No module named PIL and No module named PILLOW. What can I do? When I try all the installation commands as given in other answers, it says:
Requirement already satisfied (use --upgrade to upgrade): pillow in ./.local/lib/python3.4/site-packages
My problem is the opposite of this
Install PIL using pip install pillow
Then in the shell try import PIL or from PIL import ...
In python 2.7 there is no module named PIL,
you can use PIL features through Pillow,so PIL aka Pillow
Your output shows you are still using python3
Switch to python 2.7 and try pip install pillow
Then you can directly import PIL and use its methods completely
Related
I have facing the issue I could not import PIL in VS code.but in jupyter notebook it is imported.my python version is python 3.9.7 ,i have tried many commands to install but its not work.it keep saying like no module named as PIL .and also I couldnot import requests also in vs code.I used these commands
pip install PIL
pip install Pillow
but it didnot work
I have pillow installed and I have followed multiple answers however, when i try to run my program it says "ModuleNotFoundError: No module named 'Pillow'
I have already downloaded pillow through GIT Bash by following instructions from answers on how to and I have already tried replacing the 'pillow' for 'PIL' but i get the same error.
My code:
from Pillow import ImageTk,Image
EDIT: I am using version 3.6.5 of Python
Unfortunately I don't have enough reputation to comment on your post.
First, try these import statements:
import PIL
# OR
from PIL import *
I just want to ask you to make sure that PIL is correctly installed. Run the following python code as a single-line python file. This will print out a list of python modules installed.
help('modules')
See if PIL or Pillow on the list. If not, then PIL is not correctly installed.
I was also just wondering if you can use pip (python's package manager) to re-install Pillow. Since you're using python 3.6.5, pip is pre-installed. If you don't mind using pip, execute the following command in CMD on Windows or Terminal on a Mac to install PIL with pip:
python -m pip install pillow
Try again with your original import statements with PIL and Pillow. If none of these works, try the following import statements, again:
import PIL
# OR
from PIL import *
How this helps.
I really don't get why Python is so difficult to get up and running properly.
Anyway, I've just fresh installed Python 3.7 and PyCharm. I want to get the Python Imaging Library working within my project, but when I try to install it using PyCharm I get the following error:
pip install PIL
Non-zero exit code (1)
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\Jake\AppData\Local\Programs\Python\Python37-32\python.exe'.
Command output:
Collecting PIL
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I've attempted to run python -m pip install --upgrade pip from a CMD prompt, but I then get this error:
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
I just tried to install NumPy using the exact same method for PIL and Numpy installed without any issues whatsoever. This leads me to think that maybe PIL isn't supported for Python 3.7?
Can someone explain to me what the issue is here and help me with importing modules into my PyCharm project?
PIL is not maintained anymore. You can use Pillow instead, a more active fork of PIL.
pip install Pillow
I am trying to install the pip package PIL. However the install doesn't work throwing the following error.
Could not find a version that satisfies the requirement pil (from xhtml2pdf==0.0.4->-r virtualenv-reqs.txt (line 16)) (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pil to allow).
No matching distribution found for pil (from xhtml2pdf==0.0.4->-r virtualenv-reqs.txt (line 16))
The install does work when I have an older version of pip, but with the current version of pip 7.1.2 I am not able to download the package. I am using the following command to install the pip packages
pip install --timeout=1000 -i http://pypi.ksjc.sh.colo/simple --trusted-host pypi.ksjc.sh.colo -r virtualenv-reqs.txt
What is the issue with this. I thought it might be an SSL issue which is why I added the --trusted-host flag. Is there any way to the --allow-external flag to be used with the virtualenv-reqs file.
Pillow is a maintained fork of PIL, so I recommend using Pillow. But you can't have both installed at the same time.
First, remove both PIL and Pillow.
Then install Pillow with pip install pillow (although, depending on platform, you may need some prerequisites).
Then make sure code is using from PIL import Image rather than import Image.
You can try using Pillow instead, which is a PIL fork:
pip install Pillow
To import use following:
from PIL import Image
One solution that worked for me:
By simply installing the latest version of Pillow using pip install -U Pillow I can now call import PIL.Image
I'm using PyCharm IDE, and I had this problem. I simply hovered my mouse to the 'PIL' and there's a small pop-up. I clicked more actions and several options appear. I clicked 'Install Pillow, and then, problem solved.
One solution was, right-click on 'from PIL import Image' and click
'install Image'
I was on the PyCharm IDE.
I am very new in using python
how to install PIL on eclipse am using python 33
in my code I see this error
from PIL include Image
Error : no module named PIL
I have tried
import Image
no errors at the import part on eclipse but there is an error on
Image.open(image_stream)
Error: Undefined variable from import: open PyDev breakpoint
when I run from command window
no module named Image
The file site-packages is empty I don't know how to include packages
Your question should be
How to install packages in Python 3?
go to https://www.python.org/downloads/ and download Python 3.4 or newer. (This has the pip command to install packages)
install it.
open a console
type
pip3.4 install pillow
if this does not work then use the full path (example for windows):
C:\Python34\Scripts\pip3.4 install pillow
the import statement should work now
import PIL
If you search for this you can find many answers: https://stackoverflow.com/search?q=python+install+PIL