I am, using Ubuntu 12.04 server which by default has two versions of Python: 2.7 and 3.2. When I install PIL using the python setup.py install
terminal command, the PIL will be installed with Python 2.7. How to install PIL with Python 3.2? Because I'm using Python 3 to write my script. If my Eclipse uses Python 2.7, PIL is successfully imported. But if I choose Python 3 as my Grammar language, PIL fails to import.
- How do I uninstall PIL for python 2.7 and use Pillow instead? Ask Question 6. Browse other questions tagged python python-2.7 pip python-imaging-library pillow or ask your own question. 2 years, 1 month ago.
- Pil python 2.7 free download. WinPython WinPython is a free open-source portable distribution of the Python programming language for Windows. To use this project you must install the Python 2.7.x. Downloads: 69 This Week Last Update: 2017-10-21 See Project.
Easy Install is a python module (easy_install) bundled with setuptools that lets you automatically download, build, install. Thus, if you install EasyInstall for both Python 3.2 and 2.7, you can use the easy_install-3.2 or easy_install-2.7 scripts to install packages for the respective Python version.

P/S: I have tried the following:
- Pillow PIL (Pillow-1.7.8.zip )
- Aspell PIL (PIL-1.1.7-py3-source.zip)
UPDATE:
Using the python3
command results in an error message.
Example 1:
Example 2:
UPDATE 2
After i have run this terminal command
i can build the setup.py already,but error message at last.
UPDATE 3
Error message when use https://github.com/python-imaging/Pillow this file
SOLVED
follow the step to install
DONE!
RiggsFolly3 Answers
[(I seem to be making a mess of things in the comments, sorry about that, here's a better version)
The error clearly states that you're missing setuptools
for python3. The package python3-setuptools
should take care of that (run sudo apt-get install python3-setuptools
).
Then, as you noticed, default PIL
doesn't work for python3. The current state of the github master of Pillow
does, however. That will install by using python3 setup.py build
and sudo python3 setup.py install
.
Your instructions are too long and not entirely scripted, these are better (same platform — recent Debian/Ubuntu):
TobuTobufor those here to get scipy working with PIL (Pillow), on python3
After executing the receipe Chin Ye above, I was then able to get scipy.misc.imread and scipy.misc.imsave to be available when issuing import scipy.misc
by tweaking two lines in the file:
/usr/lib/python3/dist-packages/scipy/misc/pilutil.py
in that file, replace the lines:
to be:

the imports in scipy.misc.__init__
then worked to allow the contents of pilutil.py
to work (esp image io - from numpy array formats)
this was for Ubuntu 12.04 LTS, scipy.__version__ 0.9.0
(for more information on the tweak itself, see the docs for the Pillow implementaion of PIL)
Not the answer you're looking for? Browse other questions tagged pythonpython-imaging-library or ask your own question.
I use this command in the shell to install PIL:
then I run python
and type this: import PIL
. But I get this error:
I've never had such problem, what do you think?
Eric O Lebigot19 Answers
On some installs of PIL, You must do
instead of import PIL
(PIL is in fact not always imported this way). Since import Image
works for you, this means that you have in fact installed PIL.
Having a different name for the library and the Python module is unusual, but this is what was chosen for (some versions of) PIL.
You can get more information about how to use this module from the official tutorial.
PS: In fact, on some installs, import PIL
does work, which adds to the confusion. This is confirmed by an example from the documentation, as @JanneKarila found out, and also by some more recent versions of the MacPorts PIL package (1.1.7).
In shell, run:
Attention: PIL is deprecated, and pillow is the successor.
seheOn a different note, I can highly recommend the use of Pillow which is backwards compatible with PIL and is better maintained/will work on newer systems.
When that is installed you can do
or
etc..
At first install Pillow with
or as follows
Then in python code you may call
'Pillow is a fork of PIL, the Python Imaging Library, which is no longer maintained. However, to maintain backwards compatibility, the old module name is used.' From pillow installed, but 'no module named pillow' - python2.7 - Windows 7 - python -m install pillow
Sometimes I get this type of error running a Unitest in python. The solution is to uninstall and install the same package on your virtual environment.
Using this commands:
and
If for any reason you get an error, add sudo at the beginning of the command and after hitting enter type your password.
mu 無This worked for me on Ubuntu 16.04:
I found this on Wikibooks after searching for about half an hour.
grooveplexgrooveplexOn windows, try checking the path to the location of the PIL library. On my system, I noticed the path was
after renaming the pil
folder to PIL
, I was able to load the PIL module.
you have to install Image and pillow with your python package.
type
or run command prompt (in windows), then navigate to the scripts folder
then run below command
You will need to install Image and pillow with your python package. Rest assured, the command line will take care of everything for you.
Hit
python -m pip install image
On Windows, you need to download it and install the .exe
YumYumYumYumYumYumI used:
and pip installed PIL in Libsite-packages. When I moved PIL to Lib everything worked fine. I'm on Windows 10.
I used conda-forge to install pillow version 5, and that seemed to work for me:
the normal conda install pillow did NOT work for me.
I had the same issue while importing PIL and further importing the ImageTk and Image modules. I also tried installing PIL directly through pip. but not success could be achieved. As in between it has been suggested that PIL has been deprectaed, thus, tried to install pillow through pip only. pillow was successfully installed, further, the PIL package was made under the path : python27/Lib/site-packages/.
Now both Image and ImageTk could be imported.
I recently installed Leap. I Tried openshot and it didn't start. So came here and found a suggestion to start from the Terminal to see if there were any error.
The error I had was error missing mlt
. So I installed the python-mlt
module from Yast and imported it, tried to start but next openshot said missing pil.
I Followed the Pillow suggestion to install because Yast couldn't find any pil and imported pil. That went ok but did not start and showed Error missing goocanvas
.
The I installed goocanvas
with Yast, imported it in python, and Openshot fired up !!
With a lot of errors in the terminal like missing Vimeoclient
and lots of attributeerrors
. Well, will see if it is of any influence working with it.
I had the same problem and i fixed it by checking what version pip (pip3 --version
) is, then realizing I'm typing python<uncorrect version> filename.py
instead of python<correct version> filename.py
On windows 10 I managed to get there with:
after which in python (python 3.7 in my case) this works fine...
You are probably missing the python headers to build pil. If you're using ubuntu or the likes it'll be something like
protected by Mark RotteveelApr 22 '18 at 8:44
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?