2017-03-27 31 views
1

私は自分のサーバー上で枕を再インストールしようとしていると私はこれを取得しています:私は間違ってピローを完全にアンインストールして再インストールするには?

... 
Proceed (y/n)? y 
    Successfully uninstalled Pillow-4.0.0 
(myproject)$ pip install --upgrade --force-reinstall Pillow 
Collecting Pillow 
    Using cached Pillow-4.0.0-cp27-cp27mu-manylinux1_x86_64.whl 
Collecting olefile (from Pillow) 
    Using cached olefile-0.44.zip 
Building wheels for collected packages: olefile 
    Running setup.py bdist_wheel for olefile ... error 
    Complete output from command /home/user/.virtualenvs/myproject/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-C7Frjt/olefile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpToYPN3pip-wheel- --python-tag cp27: 
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] 
    or: -c --help [cmd1 cmd2 ...] 
    or: -c --help-commands 
    or: -c cmd --help 

    error: invalid command 'bdist_wheel' 

    ---------------------------------------- 
    Failed building wheel for olefile 
    Running setup.py clean for olefile 
Failed to build olefile 
Installing collected packages: olefile, Pillow 
    Found existing installation: olefile 0.44 
    Uninstalling olefile-0.44: 
     Successfully uninstalled olefile-0.44 
    Running setup.py install for olefile ... done 
Successfully installed Pillow-4.0.0 olefile-0.44 

(myproject)$ python 
>>> import Pillow 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named Pillow 

何をしているのですか?

編集:私はまた、枕やPILディレクトリを削除しようとしたが、私はまだそれが仕事を得ることはありません:

(myproject)$ rm -rf PIL 
(myproject)$ rm -rf Pillow-4.0.0.dist-info/ 
(myproject)$ pip install Pillow 
Collecting Pillow 
    Using cached Pillow-4.0.0-cp27-cp27mu-manylinux1_x86_64.whl 
Requirement already satisfied: olefile in ./.virtualenvs/myproject/lib/python2.7/site-packages (from Pillow) 
Installing collected packages: Pillow 
Successfully installed Pillow-4.0.0 
(myproject)$ python 
Python 2.7.5 (default, Nov 6 2016, 00:28:07) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import Pillow 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named Pillow 
>>> 

答えて

1

は使用して試してみて、それが動作するかどうかを確認。

import PIL

OR

import PIL as pillow 
from PIL import Image 
+0

OK、これは働いていました。これはどんな魔法ですか?私が枕を使用しているのは、私のDjangoプロジェクトにsorl-thumbnailを使用しているからです。 sorl-thumbnailと枕が必要です(http://sorl-thumbnail.readthedocs.io/en/latest/requirements.html#python-imaging-library-installation)。どのようにこの作品は? – xpanta

+1

ウィザードがありません。ドキュメンテーションのとおり、 'PillowはAlex ClarkとContributorsの友好的なPILフォークです。 PILはFredrik Lundhと貢献者によるPythonイメージングライブラリです.' – nomad

関連する問題