2 일 동안 오류로 고생했습니다. 스택 오버플로에서 답변을했지만 행운을 보지 않았습니다. 나는 관리자에서 모델에 접근하고 때 프로덕션 서버에서 장고 이미지 필드ImportError : 이름을 가져올 수 없습니다. _imaging 장고 관리 베개에서 액세스
class Author(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField()
url = models.URLField(blank=True, null=True)
short_bio = models.TextField(max_length=200, blank=True, null=True)
long_bio = models.TextField(max_length=5000, blank=True, null=True)
role = models.ManyToManyField(AuthorRole)
facebook_link = models.URLField(blank=True, null=True)
linkedin_link = models.URLField(blank=True, null=True)
twitter_link = models.URLField(blank=True, null=True)
gplus_link = models.URLField(blank=True, null=True)
thumbnail = models.ImageField(upload_to='images/', default='images/user_default.jpg')
를 사용하여 이미지를 선택하고 다음과 같은 오류를 던지고, 저장하려고 간단한 모델을 가지고있다. 나는 여러 번 베개를 설치하고 제거했다. 장고와 베개의 다른 버전을 사용해 보았습니다. 그건 그렇고 로컬 환경에서 잘 작동합니다.
[:error] [pid 20256:tid 139822013380352] [remote 72.48.102.12:60881]
from PIL import Image
[:error] [pid 20256:tid 139822013380352] [remote 72.48.102.12:60881] File"/home/.virtualenvs/wcsenvpython3/lib/python3.4/sitepackages/PIL/Image.py", line 67, in <module>
[:error] [pid 20256:tid 139822013380352] [remote 72.48.102.12:60881]
from PIL import _imaging as core
[:error] [pid 20256:tid 139822013380352] [remote 72.48.102.12:60881] ImportError:cannot import name _imaging
manage.py 셸에서 from PIL import _imaging
할 수 있습니다. 그래서 pythonpath가 올바르게 설정되어있는 것 같습니다.
내 virtualenv 내부에서 _imaging.cpython-34m.so 파일을 볼 수 있지만 _imaging.py 파일이 없습니다.
내 서버는 linode에서 호스팅됩니다. 그것은 우분투 14.04입니다. 나는 Apache2를 사용하고있다. 파이썬 3.4.3. 장고 1.10 베개 3.3.0. 친절한 도움은 대단히 중요합니다. 이 오류는 오랫동안 나를 괴롭 히고 있습니다.
: http://i.stack.imgur.com/nH8O3.jpg 2 : http://i.stack.imgur.com/Vpdoe.jpg
베개를 다시 설치하는 데 사용한 명령은 무엇입니까? –
pip uninstall 베개를 설치 한 후 pip 설치 베개. 귀하의 회신에 감사드립니다. 나는 그 해답을 발견했다. 아래 내 대답을 확인하십시오. –