简体   繁体   中英

PIL installed but images are still not saving

I am working on a Django project & I am new to Python. Now I have to set up my amazon server (ubuntu) for running Django Project. I installed all the necessary Package and my project is running on the server but here comes the main problem. I want to store images on the server, for that I required to install PIL which is I think used for handling image file. I installed PIL, some dependencies problem were coming i resoled that and the output of installing PIL is given below:

sudo pip install PIL
Downloading/unpacking PIL
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py

Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.7.3 (default, Apr 10 2013, 05:46:21)
              [GCC 4.6.3]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

To check the build, run the selftest.py script.

changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pildriver.py to 755
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
Successfully installed PIL
Cleaning up...

I also created a symbolic link of the following files:

sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib
sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib
sudo ln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/lib

But still I am not able to store the images on the server. A error is coming saying 'decoder jpeg not available' . now I am confused. please help me to escape from this problem. I have also installed pillow but still no success.

I don't know whether I am correct or not but some one has written in his blog that one should be careful while using sudo command with pip. I was using the sudo command with pip for installing PIL ie I was running sudo pip install PIL . This command installed PIL. But it was not working for me.

Then I simply run pip install PIL , it gives me some permission error like `access denied'. I resolved those permission problem and find out that now images are storing properly on the server and I didn't get any error further. I don't know why but it worked for me. Thanks to all of you.

Make sure that you have only one libjpeg version installed:

lsof | grep libjpeg

It turned out to be exactly my case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM