본문 바로가기

Python5

[Django] Could not find the GDAL library 에러 해결 방법 실행 환경 1. 윈도우10 + WSL + 가상환경 + Git Cloning + install requirement.txt 2. Mac OS + 가상환경 + Git Cloning + install requirements.txt python manage.py runserver 혹은 python manage.py migrate 커맨드 입력 시 아래와 같은 에러가 뜨는 경우 django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.3.0", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0"). Is GDAL installed? If it.. 2020. 2. 11.
[Python] 윈도우 pip install 오류 문제 해결 방법 | windows 10 TypeError module object is not callable 1. 환경 변수 윈도우 > 검색 > 시스템 환경 변수 편집 > 고급 > 환경 변수(N)... > 사용자 변수에서 변수 값 path 더블클릭 혹은 편집 > pip 패키지 파일의 디렉토리(Directory) 생성 여부 확인 > 없으면 추가 2. python -m pip install 터미널(Terminal) cmd 혹은 bash 등을 실행시키고, 다음과 같이 입력한다. python -m pip install something 터미널에 그냥 pip install 만 주구장창 치다보니 안됐던 것. 2019. 10. 21.
[Python] 현재 시간, 날짜 가져오기 및 표현 방법 | datetime , datetime.now (), datetime.now().strftime() 소스 코드1 from datetime import datetime print(datetime.now()) 결과1 2019-10-15 09:53:27.945272 소스 코드2 from datetime import datetime print(datetime.now().strftime('%Y %m %d %H %M %S')) 결과2 2019 10 15 09 54 50 순서대로 "년도 월 일 시간 분 초" 단위입니다. 문자열 형식이기 때문에 원하는 형태로 표현할 수 있습니다. 소스 코드3 from datetime import datetime print(datetime.now().strftime('%Y-%m-%d(%H:%M:%S)')) 결과3 2019-10-15(09:57:11) 2019. 10. 15.
[Django] pip install mysql-python 설치 | pip install mysql-python doesn't work in django pip로 mysql-python 패키지 설치하는 방법 Enter the following command in terminal(prompt, bash 등) :: pip install mysql-python 안될 때는 mysql-python 패키지를 직접 다운 받아 설치해야 한다. Enter the following command in terminal :: pip install "파일의 경로" 예시) 만약 바탕화면의 Mysql 폴더에 mysql-python 패키지 파일이 존재 한다면, terminal 에 다음과 같이 입력한다. pip install C:\Users\ONEONE\Desktop\mysql\mysqlclient-1.4.4-cp37-cp37m-win32 만약 안먹힌다? go to google 2019. 10. 1.
[파이썬/Python] 2차원 리스트를 1차원 리스트로 변환 "본 글은 '2019-09-26' 최초 작성되었으며, 업데이트 발생 시 글 내용 일부가 수정될 수 있음" Step 1. 파이썬/Python 테스트 환경 조성 1.1. 파이썬/Python 프로그램 실행 1.2. 파이썬/Python 프로그램 실행 화면 Step 2. 소스 코드 작성 2.1. 소스 코드 내용 #2차원 리스트 생성 list_2d = [[1,2],[3,4],[5,6]] #1차원 리스트로 변환 #방법1 - sum 함수 list_1d = sum(list_2d, []) #출력 값 #[1, 2, 3, 4, 5, 6] 2.2. 소스 코드 실행 결과 2.2. 그 외 방법 #방법2 - itertools > chain > from_iterable import itertools list_1d = list(iter.. 2019. 9. 26.