Python/ERROR LOG
-
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path' driver = webdriver.Chrome(executable_path=driver_path, options=options) 위의 코드로 driver path를 들고올 경우 에러가 납니다. from selenium import webdriver from selenium.webdriver.chrome.service import Service driver_path = "chromedriver path" # WebDriver의 경로 설정 service = Service(executable_path=driver_path) options = webdriver...
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path' driver = webdriver.Chrome(executable_path=driver_path, options=options) 위의 코드로 driver path를 들고올 경우 에러가 납니다. from selenium import webdriver from selenium.webdriver.chrome.service import Service driver_path = "chromedriver path" # WebDriver의 경로 설정 service = Service(executable_path=driver_path) options = webdriver...
2024.03.23 -
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath' 위와 같은 에러가 난다면 현재 xpath사용법이 바뀌어서 그렇습니다. (X) element = driver.find_element_by_xpath('//*[@id="content"]/div[1]') (O) from selenium.webdriver.common.by import By element = driver.find_element(By.XPATH, '//*[@id="content"]/div[1]') selenium 4.18.1 기준 위의 코드로 바꿔주시면 잘 작동될것입니다.
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath' 위와 같은 에러가 난다면 현재 xpath사용법이 바뀌어서 그렇습니다. (X) element = driver.find_element_by_xpath('//*[@id="content"]/div[1]') (O) from selenium.webdriver.common.by import By element = driver.find_element(By.XPATH, '//*[@id="content"]/div[1]') selenium 4.18.1 기준 위의 코드로 바꿔주시면 잘 작동될것입니다.
2024.03.23 -
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 123.0.6312.58 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome 위와 같이 Selenium 웹 드라이버 경로 지정 사용할때 오류가 뜰 수 있습니다. 현재 크롬 버전이 웹드라이버 버전이랑 맞지 않아서 그렇습니다. https://googlechromelabs.github.io/chrome-for-test..
selenium.common.exceptions.SessionNotCreatedException Current browser version is 123.0.6312.58 with binary pathselenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 114 Current browser version is 123.0.6312.58 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome 위와 같이 Selenium 웹 드라이버 경로 지정 사용할때 오류가 뜰 수 있습니다. 현재 크롬 버전이 웹드라이버 버전이랑 맞지 않아서 그렇습니다. https://googlechromelabs.github.io/chrome-for-test..
2024.03.23 -
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home 이미지 크롤링 스크립트를 간만에 돌릴려고하면 한번씩 이런 에러가 뜨곤 합니다. selenium과 webdriver-manager 패키지 버전을 최신화하면 해결이 됩니다. pip install selenium pip install webdriver-manager 24.3.21 기준 아래의 버전으로 최신화해주니 정상작동 되었습니다. selenium 4.18.1 webdriver-manager 4.0.1
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/homeselenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home 이미지 크롤링 스크립트를 간만에 돌릴려고하면 한번씩 이런 에러가 뜨곤 합니다. selenium과 webdriver-manager 패키지 버전을 최신화하면 해결이 됩니다. pip install selenium pip install webdriver-manager 24.3.21 기준 아래의 버전으로 최신화해주니 정상작동 되었습니다. selenium 4.18.1 webdriver-manager 4.0.1
2024.03.21 -
gunicorn으로 서버를 실행하니 다음과 같은 에러가 나왔습니다. gunicorn app:app --bind 127.0.0.1:8020 [ERROR] Error handling request /docs Traceback (most recent call last): File "/home/user/anaconda3/envs/forge/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 135, in handle self.handle_request(listener, req, client, addr) File "/home/user/anaconda3/envs/forge/lib/python3.10/site-packages/gunicorn/workers/sy..
TypeError: FastAPI.__call__() missing 1 required positional argument: 'send'gunicorn으로 서버를 실행하니 다음과 같은 에러가 나왔습니다. gunicorn app:app --bind 127.0.0.1:8020 [ERROR] Error handling request /docs Traceback (most recent call last): File "/home/user/anaconda3/envs/forge/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 135, in handle self.handle_request(listener, req, client, addr) File "/home/user/anaconda3/envs/forge/lib/python3.10/site-packages/gunicorn/workers/sy..
2024.03.19 -
Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey' 위와 같은 에러가 나타난다면 아래의 명령어를 입력해보세요. SOLUTION sudo apt install libgtk2.0-dev pkg-config pip uninstall opencv-python-headless pip uninstall opencv-python pip install opencv-python
Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey' 위와 같은 에러가 나타난다면 아래의 명령어를 입력해보세요. SOLUTION sudo apt install libgtk2.0-dev pkg-config pip uninstall opencv-python-headless pip uninstall opencv-python pip install opencv-python
2024.01.18 -
Ubuntu에서 아나콘다 설치 후 environment create시 아래처럼 에러가 난다면 Collecting package metadata (current_repodata.json): failed NotWritableError: The current user does not have write permissions to a required path. path: /home/user/anaconda3/pkgs/cache/9e0f62c3.json uid: 1000 gid: 1000 If you feel that permissions on this path are set incorrectly, you can manually change them by executing $ sudo chown 1000:1000..
NotWritableError: The current user does not have write permissions to a required path.Ubuntu에서 아나콘다 설치 후 environment create시 아래처럼 에러가 난다면 Collecting package metadata (current_repodata.json): failed NotWritableError: The current user does not have write permissions to a required path. path: /home/user/anaconda3/pkgs/cache/9e0f62c3.json uid: 1000 gid: 1000 If you feel that permissions on this path are set incorrectly, you can manually change them by executing $ sudo chown 1000:1000..
2024.01.08 -
"IndexError: 빈 deque에서 팝 작업" 오류는 비어있는 deque (더블 엔디드 큐)에서 요소를 제거하려고 할 때 발생합니다. deque는 양쪽 끝에서 요소를 효율적으로 삽입하고 삭제할 수 있는 데이터 구조입니다. 그러나 비어있는 deque에서 요소를 팝하려고 하면 요소가 없기 때문에 IndexError가 발생합니다. 다음은 이 오류가 발생할 수 있는 예입니다. from collections import deque my_deque = deque() # 비어있는 deque에서 요소를 팝하려고 시도 popped_element = my_deque.pop() 이 오류를 피하려면 팝 작업을 수행하기 전에 deque에 요소가 있는지 확인해야 합니다. len() 함수를 사용하여 deque가 비어있지 않은..
IndexError: pop from an empty deque"IndexError: 빈 deque에서 팝 작업" 오류는 비어있는 deque (더블 엔디드 큐)에서 요소를 제거하려고 할 때 발생합니다. deque는 양쪽 끝에서 요소를 효율적으로 삽입하고 삭제할 수 있는 데이터 구조입니다. 그러나 비어있는 deque에서 요소를 팝하려고 하면 요소가 없기 때문에 IndexError가 발생합니다. 다음은 이 오류가 발생할 수 있는 예입니다. from collections import deque my_deque = deque() # 비어있는 deque에서 요소를 팝하려고 시도 popped_element = my_deque.pop() 이 오류를 피하려면 팝 작업을 수행하기 전에 deque에 요소가 있는지 확인해야 합니다. len() 함수를 사용하여 deque가 비어있지 않은..
2023.09.01