Easy_install Pil Python 2.7

Active5 years, 10 months ago

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.

Pil python documentation

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!

RiggsFolly
75.4k18 gold badges78 silver badges118 bronze badges
John WalkerJohn Walker
3933 gold badges18 silver badges58 bronze badges

3 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.

akaIDIOTakaIDIOT
8,3983 gold badges20 silver badges29 bronze badges

Your instructions are too long and not entirely scripted, these are better (same platform — recent Debian/Ubuntu):

TobuTobu
20.9k3 gold badges73 silver badges91 bronze badges

for 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:

Install pil python windows

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)

Matt S.Matt S.

Not the answer you're looking for? Browse other questions tagged pythonpython-imaging-library or ask your own question.

Active9 days ago

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 Lebigot
59.9k38 gold badges174 silver badges225 bronze badges
Asma GheisariAsma Gheisari
1,7046 gold badges24 silver badges45 bronze badges

19 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 PILdoes 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).

Eric O LebigotEric O Lebigot
59.9k38 gold badges174 silver badges225 bronze badges

In shell, run:

Attention: PIL is deprecated, and pillow is the successor.

sehe
286k35 gold badges361 silver badges487 bronze badges
zhiming wangzhiming wang
2,2032 gold badges7 silver badges2 bronze badges

On 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..

DamianDamian

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

Community
Orhan CelikOrhan Celik

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 無
43.7k25 gold badges105 silver badges143 bronze badges
Fernando MunozFernando Munoz
2,1731 gold badge13 silver badges16 bronze badges

This worked for me on Ubuntu 16.04:

I found this on Wikibooks after searching for about half an hour.

grooveplexgrooveplex
1,5894 gold badges17 silver badges26 bronze badges
Conor CosnettConor Cosnett

On 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.

Robert
4,10813 gold badges55 silver badges111 bronze badges
KomlaKomla

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

azdoudazdoud

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

Dipanshu SehjalDipanshu Sehjal
saigopisaigopi

On Windows, you need to download it and install the .exe

YumYumYumYumYumYum
10.1k39 gold badges171 silver badges319 bronze badges

I used:

and pip installed PIL in Libsite-packages. When I moved PIL to Lib everything worked fine. I'm on Windows 10.

cromastrocromastro

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.

Geoff PerrinGeoff Perrin

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.

Prateek JainPrateek Jain

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.

Thomasleveil
45.2k9 gold badges88 silver badges90 bronze badges
JohanJohan

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

Ori BarmatzOri Barmatz

On windows 10 I managed to get there with:

after which in python (python 3.7 in my case) this works fine...

andrew pateandrew pate

You are probably missing the python headers to build pil. If you're using ubuntu or the likes it'll be something like

CrankyadminCrankyadmin

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?

Download Pil For Python

Not the answer you're looking for? Browse other questions tagged pythonpython-imaging-libraryeasy-install or ask your own question.