2017-01-19 261 views
1

有這種類似的問題: PIL - libjpeg.so.8: cannot open shared object file: No such file or directory導入錯誤:libjpeg.so.8:無法打開共享對象文件:沒有這樣的文件或目錄

,但我得到一個稍微不同的輸出:

$ python manage.py    
Traceback (most recent call last): 
    File "manage.py", line 8, in <module> 
    execute_from_command_line(sys.argv) 
    File "some_virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line 
    utility.execute() 
    File "some_virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 327, in execute 
    django.setup() 
    File "some_virtualenv/lib/python3.5/site-packages/django/__init__.py", line 18, in setup 
    apps.populate(settings.INSTALLED_APPS) 
    File "some_virtualenv/lib/python3.5/site-packages/django/apps/registry.py", line 108, in populate 
    app_config.import_models(all_models) 
    File "some_virtualenv/lib/python3.5/site-packages/django/apps/config.py", line 202, in import_models 
    self.models_module = import_module(models_module_name) 
    File "some_virtualenv/lib64/python3.5/importlib/__init__.py", line 126, in import_module 
    return _bootstrap._gcd_import(name[level:], package, level) 
    File "<frozen importlib._bootstrap>", line 986, in _gcd_import 
    File "<frozen importlib._bootstrap>", line 969, in _find_and_load 
    File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked 
    File "<frozen importlib._bootstrap>", line 673, in _load_unlocked 
    File "<frozen importlib._bootstrap_external>", line 665, in exec_module 
    File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed 
    File "some_django_project/some_django_app/models.py", line 25, in <module> 
    from versatileimagefield.fields import VersatileImageField 
    File "some_virtualenv/lib/python3.5/site-packages/versatileimagefield/fields.py", line 11, in <module> 
    from .files import VersatileImageFieldFile, VersatileImageFileDescriptor 
    File "some_virtualenv/lib/python3.5/site-packages/versatileimagefield/files.py", line 11, in <module> 
    from .mixins import VersatileImageMixIn 
    File "some_virtualenv/lib/python3.5/site-packages/versatileimagefield/mixins.py", line 8, in <module> 
    from .datastructures import FilterLibrary 
    File "some_virtualenv/lib/python3.5/site-packages/versatileimagefield/datastructures/__init__.py", line 3, in <module> 
    from .sizedimage import SizedImage 
    File "some_virtualenv/lib/python3.5/site-packages/versatileimagefield/datastructures/sizedimage.py", line 11, in <module> 
    from .base import ProcessedImage 
    File "some_virtualenv/lib/python3.5/site-packages/versatileimagefield/datastructures/base.py", line 3, in <module> 
    from PIL import Image 
    File "some_virtualenv/lib/python3.5/site-packages/PIL/Image.py", line 66, in <module> 
    from PIL import _imaging as core 
ImportError: libjpeg.so.8: cannot open shared object file: No such file or directory 

線25我models.py

from versatileimagefield.fields import VersatileImageField 

Django的版本:

$ pip freeze | grep Django 
Django==1.9.5 

枕頭版本:

​​

系統:

$ uname -a       
Linux zbookhack-gableroux-local 4.9.3-200.fc25.x86_64 #1 SMP Fri Jan 13 01:01:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux 

的libjpeg安裝我的系統上

$ sudo dnf install libjpeg 
Package libjpeg-turbo-1.5.1-0.fc25.x86_64 is already installed, skipping. 
Package libjpeg-turbo-1.5.1-0.fc25.i686 is already installed, skipping. 
Dependencies resolved. 
Nothing to do. 
Complete! 

回答

3

Pillow固定這個版本3.3及以上,升級包爲我工作:)

pip install Pillow==4 

pip install Pillow --upgrade 

這裏有一些相關的問題,枕在GitHub上:

#1952 #2123 #2167

相關問題