PyInstaller Error – expected str, bytes or os.PathLike object, not NoneType

Operating System: Windows 10

Python Version: 3.7.2

PyInstaller Version: 3.4

This is a fairly annoying error without much information to go by. But luckily for us, a responsible coder has provided a solution to this.

The solution lies in making changes to the file bindepend.py in the Project Folder

<ProjectName>/venv/lib/python3.7/Pyinstaller/depend/bindepend.py

Rename the existing file to bindepend_old.py and replace this file with the one available on GitHub as provided below.

https://github.com/Loran425/pyinstaller/blob/14b6e65642e4b07a4358bab278019a48dedf7460/PyInstaller/depend/bindepend.py

Converting to exe using PyInstaller should work perfectly now.

Let me know how you fared.