본문 바로가기

PYTHON

[파이썬] Fillow 라이브러리 설치

이미지 파일을 관리하기 위해 models.py에 imageField를 추가하고 마이그레이션을 하면 오류가 발생한다.

Fillow 라이브러리를 설치하면 해결된다.

 

Fillow : 이미지를 처리하기 위한 라이브러리

F:\github\django_blog(main -> origin)
(venv) λ python manage.py makemigrations
SystemCheckError: System check identified some issues:

ERRORS:
blog.Post.head_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
        HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".

F:\github\django_blog(main -> origin)
(venv) λ pip install Pillow
Collecting Pillow
  Downloading Pillow-9.1.1-cp310-cp310-win_amd64.whl (3.3 MB)
     |████████████████████████████████| 3.3 MB 6.8 MB/s
Installing collected packages: Pillow
Successfully installed Pillow-9.1.1
WARNING: You are using pip version 21.3.1; however, version 22.1.1 is available.
You should consider upgrading via the 'F:\github\django_blog\venv\Scripts\python.exe -m pip install --upgrade pip' command.

F:\github\django_blog(main -> origin)
(venv) λ pip list
Package    Version
---------- -------
asgiref    3.5.2
Django     4.0.4
Pillow     9.1.1
pip        21.3.1
setuptools 60.2.0
sqlparse   0.4.2
tzdata     2022.1
wheel      0.37.1
WARNING: You are using pip version 21.3.1; however, version 22.1.1 is available.
You should consider upgrading via the 'F:\github\django_blog\venv\Scripts\python.exe -m pip install --upgrade pip' command.