geemap package not being included in pyinstaller

52 views
Skip to first unread message

Olivier H.

unread,
May 4, 2021, 12:06:35 PM5/4/21
to PyInstaller
I am trying to use pyinstaller to compile a script, but no matter what I do I cannot get it to be included. The package in question is geemap

The package is an import in my script, but is not included. I also tried using a --hiddenimport but it was still not included.

Really hope someone can help out! :)

bwoodsend

unread,
May 4, 2021, 1:40:25 PM5/4/21
to PyInstaller

Sounds like you’re just mixing up virtual environments. Try running from a terminal:

python your-code.py

and (note case-sensitive):

python -m PyInstaller your-code.py

Either the 1st one should fail with ModuleNotFoundError: geemap, in which case either pip install geemap into your current environment or track down and activate the virtual environment that geemap is already installed in.
Or the 2nd one should fail with python: No module named PyInstaller, in which case PyInstaller is not installed in this environment and you should pip install pyinstaller.

Olivier H.

unread,
May 5, 2021, 4:00:35 AM5/5/21
to PyInstaller
I am avoiding virtual environments. I have geemap installed in my global environment, and I run PyInstaller from there! 

But I need this to work on a PC without a geemap installation.

After running PyInstaller, I pip uninstall geemap and then run the executable. But I then get the geemap import error, even though the package should be included in the executable setup by PyInstaller, correct?


bwoodsend

unread,
May 5, 2021, 5:19:00 AM5/5/21
to PyInstaller
> I am avoiding virtual environments. I have geemap installed in my global environment, and I run PyInstaller from there!

Can you check that by running the commands I gave you? A lot of people think that they are using the global environment but don't realize that PyCharm/conda/umpteen other editors create virtual environments for you by default.

And yes, PyInstaller will include geemap if its available when it builds the executable. The fact that geemap wasn't included indicates that it couldn't find it during setup.

Olivier H.

unread,
May 10, 2021, 3:19:27 AM5/10/21
to PyInstaller
Running your commands shows no errors for either. I tried running PyInstaller from a custom geemap Anaconda environment, but still geemap is not packaged when running PyInstaller. No clue what is going on!
Reply all
Reply to author
Forward
0 new messages