7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows10でPython3.7.2とPyInstaller3.4でExe作るとTypeError: expected str, bytes or os.PathLike object, not NoneType

Posted at

Pyinstallerでexe化するとエラーが・・・

この記事でバイナリ検索とリスト出力処理を作成したのですが、
同僚への配布用にWindowsのExe化をしましたが・・・

TypeError: expected str, bytes or os.PathLike object, not NoneType が発生してexeが作成できていませんでした。

環境

Windows 10 Pro
Python 3.7.2
PyInstaller 3.4

TypeErrorが発生した際のexe化までの手順

1.python -m venv venv で仮想環境を作成した。
2..\venv\script\activate.bat で仮想環境へ切替した。
3.pip install PyInstaller
4.この記事 のソースを書いた。
5.pyinstaller SearchLCovd.py --onefile でexe化できると信じて実行した。
TypeError: expected str, bytes or os.PathLike object, not NoneType が発生!!

解決にたどり着いた

いろいろ備忘録日記さんのPythonメモ-97 (python 3.7 + pyinstaller 3.4 + venv で TypeError が出る件)(expected str, bytes or os.PathLike object, not NoneType) で解決にいたりました。

どうするのか?

詳しくはこちらに情報をご覧いただきたいのですが・・・

1.自分の環境の Lib/PyInstaller/depend/bindepend.py (私の場合はvenvしていたので、venv\Lib\site-packages\PyInstaller\depend\bindepend.py)をテキストエディタで開く
2.紹介されているgithub.comのpyinstallerプルリクソース変更内容を「1.」で開いたソースファイルへ追記する。
3.テキストエディタを上書き保存して、閉じる。
4.改めてpyinstaller SearchLCovd.py --onefile でexe化できると信じて実行しました。
今度はExeが出来上がりました。

・・・英語が読めれば、すんなり検索できたり、解決できたりするんでしょうね・・・

7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?