pkg_resources.DistributionNotFound: pygmt

I converted my pygmt code into executable file using pyinstaller. I get this error when I run the executable.

pkg_resources.DistributionNotFound: pygmt

How can I fix this?

I tried adding --additional-hooks-dir with a file in it that contains

from PyInstaller.utils.hooks import collect_all
datas, binaries, hiddenimports = collect_all(‘pygmt’)

Update: Problem Solved

I installed a separate GMT aside from the gmt inside my anaconda env then add it to the path

1 Like