我有一个用django设计的完美运行的网站,但我意外地卸载了自制软件,因此所有的postgres,Pillow等包都丢失了,因此重新安装了它们,但当我运行django runserver时,我得到了以下错误
Unhandled exception in thread started by <function wrapper at 0x1071c11b8>
Traceback (most recent call last):
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/utils/autoreload.py", line 93, in wrapper
fn(*args, **kwargs)
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 101, in inner_run
self.validate(display_num_errors=True)
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/core/management/base.py", line 310, in validate
num_errors = get_validation_errors(s, app)
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/core/management/validation.py", line 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/db/models/loading.py", line 196, in get_app_errors
self._populate()
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/db/models/loading.py", line 78, in _populate
self.load_app(app_name)
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/db/models/loading.py", line 99, in load_app
models = import_module('%s.models' % app_name)
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/Users/shivakrishna/shiva/app/post-web-1.6/modes/directory/models.py", line 24, in <module>
from PIL import Image, ImageDraw, ImageFont
File "/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/PIL/Image.py", line 67, in <module>
from PIL import _imaging as core
ImportError: dlopen(/Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/PIL/_imaging.so, 2): Library not loaded: /opt/local/lib/libjpeg.9.dylib
Referenced from: /Users/shivakrishna/.virtualenvs/project/lib/python2.7/site-packages/PIL/_imaging.so
Reason: image not found我尝试了stackoverflow上所有与此相关的帖子,如下所示
brew uninstall libjpeg
brew install libjpeg但是他们都不工作,我的brew list
boost gdal gmp liblwgeom libxml2 mysql postgis sfcgal
cgal geoip jpeg libpng little-cms2 openssl postgresql sqlite
freetype geos json-c libspatialite lzlib pcre proj webp
freexl giflib libgeotiff libtiff mpfr pillow readline那么为什么它不能加载/opt/local/lib/libjpeg.9.dylib库呢?以及如何修复它?
发布于 2017-02-19 00:59:17
对于这种特殊的问题,下面的方法适用于我
pip install --upgrade pillowhttps://stackoverflow.com/questions/42317641
复制相似问题