728x90
반응형

SELF-IMPROVEMENT/error 기록 9

pyinstaller에서 webdriver_manager 사용하기. 오류 해결.

1. cmd에 webdriver_manger 설치 pip install webdriver_manager 2. 크롬 옵션 지정 from selenium import webdriver from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options chrome_options = webdriver.ChromeOptions..

DataFrame에서 날짜 변환 시 한글(월일) 추가 (+locale error)

날짜 형식을 변환하고 한글(월일)을 넣고 싶은 경우 아래와 같이 에러가 남. df['날짜'] = [i.strftime("%m월 %d일") for i in df['날짜']] >> 'locale' codec can't encode character '\uc6d4' in position 2: encoding error 해결방법1) 모두 적용 #코드추가 import locale print(locale.getlocale()) locale.setlocale(locale.LC_ALL, '') print(locale.getlocale()) 해결방법2) 해당 코드만 적용 df['날짜'] = [i.strftime("%m월 %d일".encode('unicode-escape').decode()).encode().decode(..

Anaconda3 설치 오류

Anaconda3 설치가 안될 때, 아래 두 가지 경우를 생각해 볼 수 있다. 1. 저장경로의 폴더 이름이 한글로 되어 있는 경우 2. Anaconda3 설치 이전 파이썬을 설치했던 경우 1. 저장경로의 폴더 이름이 한글로 되어 있는 경우 아래와 같은 에러 문구가 뜰 경우 저장경로 폴더의 이름이 한글 또는 특수문자가 포함되었는지 잘 살펴보자. Error. Due to incompatibility with several Python libraries, 'Destination Folder' cannot contain non-ascii characters(special characters or diacritics). Please choose another location. 나 같은 경우는 바로 '사용자' 라는..

토픽모델링 TerminatedWorkerError

이전에는 잘 돌아가던 토픽모델링에서 갑자기 에러가 남. TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker. 구글링하니 거의 scikit-learn 모델 관련이었고, 파라미터의 n_jobs 값을 조정하면 해결되어 보였음. 1)토픽모델링 gensim.models.ldamodel.LdaModel 과 2)토픽모델링 시각화 pyLD..

[SQL오류] Recursive query aborted after 1001 iterations.

문제발생 WITH RECURSIVE TIME AS ( SELECT 0 AS HOUR UNION ALL SELECT HOUR + 1 FROM TIME) SELECT HOUR, COUNT(HOUR)-1 FROM ( SELECT HOUR FROM TIME UNION ALL SELECT HOUR(DATETIME) FROM ANIMAL_OUTS) VALID GROUP BY HOUR 오류) Recursive query aborted after 1001 iterations. Try increasing @@cte_max_recursion_depth to a larger value. 해결 1001번 반복 이후부터 리컬시브 쿼리가 유실되었다는 뜻. HOUR+1(0부터 1씩 증가) 입력후 반복을 언제까지 할 것인지 지정해 ..

[Google Colab] 코랩 텍스트 파일 불러오기 오류

뉴욕타임즈 뉴스 기사 요약하기(Sequence to sequence) from google.colab import drive drive.mount('/content/drive') !git clone https://github.com/hengluchang/deep-news-summarization.git 오류 : 텍스트가 불러들여 오지 않음. Data_set = np.loadtxt('/content/deep-news-summarization/dataset/article.txt', delimiter=" ") Data_set = pd.read_csv('/content/deep-news-summarization/dataset/article.txt') 해결 : # 뉴욕타임즈 기사 불러오기 with open('/c..

[Python] 파이썬 에러들

1. IndentationError IndentationError: expected an indented block 들여쓰기 에러 IndentationError: unindent does not match any outer indentation level tap키와 space키를 혼용했거나 줄이 서로 맞지 않음 IndentationError: unexpected indent 쓸데없는 들여쓰기가 있는지 확인 2. SyntaxError SyntaxError: invalid syntax 구문 에러 해결 : 오류난 문법 위치를 찾아 수정해야 함. SyntaxError: EOL while scanning string literal 따옴표 잘 보기 SyntaxError: can't assign to keyword ..

[Flask] Flask run 사이트에 연결할 수 없음 오류

문제 : 코드 문제가 없는데도 flask run 후 사이트에 연결할 수 없었음. 해결 1번 : port가 입력안됨(5000) git bash 에서 url 클릭시 포트까지 링크되지 않았던 것. :5000/ port까지 잘 입력하자. 2번 : flask run을 입력하는 다이렉트 위치 만약 app이라는 폴더 안에 hello_app이라는 폴더가 있고 그 안에 hello.py라는 파일이 있을 때 $ export FLASK_APP=hello_app $ flask run 위처럼 hello_app을 불러오려면 flask run을 실행하는 위치는 app이라는 폴더여야함. 만약 export FLASK_APP=hello.py 하려면 hello_app에서 flask run을 실행해야함. 즉, 상위폴더에서 flask run ..

[VS Code] conda 가상환경 CommandNotFoundError

문제 : vs code에서 콘다 가상환경을 실행시키고 싶은데 자꾸 CommandNotFoundError 가 뜬다. conda init 이라던지 모두 쳐봤지만 도움이 되지 않았다. 해결 : 1. source deactivate 2. conda deactivate 3. conda activate 가상환경이름 실행 위 순서대로 가상환경을 빠져나오는 코드를 입력 후 activate 실행하니 해결되었다. (n322) 표시처럼 경로위에 가상환경 표시가 있어야만 가상환경에 들어온건 줄 알았는데.. 아니었나보다.

728x90
반응형