코딩(44)
-
[Python] Apple Mac OS Flask 실행 시 5000 port 중복 오류 해결 (with. AirPlay Receiver)
안녕하세요 코딩왕 코주부입니다. Macbook에서 파이썬 flask app 실행 시 발생하는 Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different port. On macOS, try disabling the 'AirPlay Receiver' service from System Preferences -> Sharing. 에러입니다. 5000번 포트가 'AirPlay Receiver' service의 포트와 중복되었다네요. 해결 방법은 간단합니다. Macbook → 시스템 환경설정 → AirPlay 수신 모드 AirPlay 수신 모드 해제 수신 모드 체크를..
2022.08.08 -
[Python] Mac에서 zsh: command not found: python 오류 해결 방법
안녕하세요 코딩왕 코주부입니다! Macbook에서 플라스크를 실행하기 위한 시도를 해봅니다. WORKSPACE/project/fingerbot 디렉토리의 app.py (flask) 파일을 python으로 실행하기 위해 명령어를 입력합니다. python app.py ## Error 발생 ## python 을 못찾겠다고 에러가 발생하는 군요. zsh: command not found: python 이때, 해결 방법을 알려드리겠습니다. 프롬프트 창에서 아래와 같은 명령어를 입력해봅니다. type python python2 python3 python not found python2 not found python3 is ~~~~!!!!! python, python2 은 없고 python3만 설치되어 있군요. 그렇..
2022.08.06 -
[Python] Mac OS 이용 시 ssl: certificate_verify_failed 에러 해결 방법 (urlerror)
안녕하세요 코딩왕 코주부입니다. 며칠 전 맥북으로 파이썬 사용 중 pip install ** 명령어를 실행하다가 마주친 에러입니다. urlerror: 이 에러를 해결하기 위한 방법은 아래와 같습니다! import ssl ssl._create_default_https_context = ssl._create_unverified_context ## 해결 완료 ## 해결 방법을 못 찾아서 꽤나 헤맸었는데 컴맹이 맥북 쓰기 참 쉽지 않네요 ㅎㅎ
2022.07.24 -
[Python] 파이썬으로 전자공시시스템(DART) API 활용 상장기업 조회하는 방법 (with. corpCode.xml)
안녕하세요 코딩왕 코주부입니다. 주식 투자를 할 때 기업 정보를 얻기 위해 다양한 방법을 이용하고 계실텐데요. 오늘은 DART(전자공시시스템) 에서 Open API를 활용하여 Python 으로 국내 주식 상장 기업 리스트를 받아오는 방법을 정리해보았습니다. 먼저, DART에서 API Key (crtfc_key)를 발급받으셔야 합니다. https://opendart.fss.or.kr/uss/umt/EgovMberInsertView.do 전자공시 OPENDART 시스템 | 인증키 신청 opendart.fss.or.kr 위 사이트에 접속 후, 인증키 신청을 진행하시면 됩니다. 크게 어렵지 않으니, 천천히 발급 받으시기 바랍니다! 발급 받고 나면, 위와 같이 API Key를 확인할 수 있습니다. (Key는 고유..
2022.07.17 -
[Python] 파이썬 Module 설치 경로 쉽게 확인 하는 방법 (with. site-packages)
안녕하세요 코주부입니다. 내가 사용하고 있는 python의 모듈 내부 구조가 어떻게 구성되어 있는지 궁금할 때! 해당 module 을 뜯어봐야할 일이 생기죠. 그 때! 지금까지 설치된 Python의 module이 모여있는 package 폴더의 경로를 찾는 방법을 알려드리겠습니다. import site site.getsitepackages() ## 출력 1 : Python 설치 경로 ## ## 'c:\\Users\\junjj\\AppData\\Local\\Programs\\Python\\Python38' ## 출력 2 : Module 설치 경로 ## ## 'c:\\Users\\junjj\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages' ##..
2022.07.16 -
[Python] urlopen 함수 사용 시 SSL Error 해결 방법 (SSLCertVerificationError)
안녕하세요. 코딩왕 코주부입니다! Python 의 urllib.request 라이브러리에서 urlopen 함수를 사용할 때 SSLCertVerificationError 에러 해결 방법에 대한 기록입니다. URL request → API 를 활용하여 XML 파일 요청 코드 실행 중 에러가 발생했습니다. from urllib.request import urlopen url = 'https://opendart.fss.or.kr/api/corpCode.xml' res = urlopen(url) print(res) 에러 발생!! URLError: 해결 방법은? import ssl context = ssl._create_unverified_context() res = urlopen(url, context = con..
2022.06.19