리눅스에서 .env를 읽지 못하는 경우(vscode에서는 됨)
에러 TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' 변수 선언했던 int(os.getenv('TEST')) 소스에서 에러 발생 class MainProcess(): test = int(os.getenv('TEST')) 증상 리눅스에서 실행할 때 에러 python main.py 했을 때 에러 python vscode launch.json으로 실행 시 에서는 에러 없음 원인 vscode에서 launch.json 통해 실행 시 .env를 자동으로 찾아서 로드해주지만 그냥 실행하면 안 해주기 때문이다. 해결 dotenv.load_dotenv() 선언해줌으로서 해결 완료 import dotenv ..