宇宙の渚を眺めるエンジニアのブログ

技術的な備忘録や、日々思ったこと、たまに宇宙関連について綴る

pyinstaller --onefile で PermissionError が出たときの解決法

pyinstaller --onefile {path-to-src}/main.py をしようとしたときに、

(中略)
PermissionError: [Errno 1] Operation not permitted: '{path-to-src}/dist/main'

が出て困った。
その前に pyinstaller main.py を実行しており、すでに{path-to-src}/dist/mainディレクトリができていたので、そのディレクトリを消去すると、エラーが解決できた。