반응형
sreamlit은 브라우져에서 동작하기 때문에
streamlit run xxxxxxx.py 형태로 실행하게 됩니다.
브라우저 상에서 st.write()만 가지고 디버깅하기에는 어려움이 있기때문에
일반적인 디버깅 방식으로 실행하는 법을 알아보겠습니다.
1. 기본 설정
일단
VSCode의 Python 디버거가 debugpy를 찾지 못할 경우, debugpy 모듈이 설치되지 않았거나 올바르게 설치되지 않았을 가능성이 있습니다.
pip install debugpy 설치
vscode에서 현재 프로젝트의 launch.json 수정하기
일반적으로 파일 디버깅을 위해서는 아래와 같이 하는데..
{
"version": "0.2.0",
"configurations": [
{
"name": "Python 디버거: 현재 파일",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
}
]
}
2. streamlit 사용하여 디버깅하기
streamlit을 사용하기 위해서는 다음과 같이 설정 해야 한다.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
"name": "Python: Streamlit",
"type": "python",
"request": "launch",
"module": "streamlit",
"args": [
"run",
"${workspaceFolder}/실행할파이썬파일.py"
],
"console": "integratedTerminal",
"justMyCode": false
}
]
}
반응형
'IT > 개발' 카테고리의 다른 글
Rocky Linux 파이썬으로 네트워트 인터페이스 정보 가져오기, 각 트래픽 량 계산하기 (랜카드별 데이터송수신 데이터량) (0) | 2024.11.08 |
---|---|
python 에서 Rocky linux 시스템 리소스 정보 가져오기(hostname, cpu, ram 사용량 , gpu 사용량, disk 사용량 등) (0) | 2024.11.08 |
vscode에서 break point가 동작하지 않을때 해결 (0) | 2024.08.27 |
LLM 환각(Hallucination)에 대한 모델 평가(갈릴레오AI 벤치마크, 클로드, GPT, 큐원, 제미나이 등) (0) | 2024.08.01 |
미스트랄 라지2 출시 개요 (Mistral Large 2, Llama 3.1 능가) (0) | 2024.07.26 |