Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging with pyinstaller #59

Closed
iiMox opened this issue Jan 10, 2022 · 7 comments
Closed

Packaging with pyinstaller #59

iiMox opened this issue Jan 10, 2022 · 7 comments

Comments

@iiMox
Copy link

iiMox commented Jan 10, 2022

Hello, I am using the localetileserver, and it is working but when I try to convert my py to exe the program shows me this error.

large_image.exceptions.TileSourceError: No available tilesource for C:\Users\iiMox\AppData\Local\Temp_MEI50602\NE1_LR_LC_SR_W_DR.tif

@banesullivan
Copy link
Owner

but when I try to convert my py to exe

You're going to need to provide a lot more context here...

I have no experience bundling GDAL (the primary dependency of this package) into packaged environments or executables.

@banesullivan
Copy link
Owner

Please provide more context on how you're creating an exe.

Also please provide a full stack trace and a scooby report:

import localtileserver
print(localtileserver.Report())

@iiMox
Copy link
Author

iiMox commented Jan 11, 2022

Thank you for your response.
Basically, I'm trying to build a localization program that takes images with gpsinfo and try to mark the positions on an offline map. It is working while debugging but the problem in the exe.

I am using auto-py-to-exe to do the render thing I here are the inputs :

pyinstaller --noconfirm --onefile --console --add-data "C:/Users/iiMox/Desktop/Finale/colorbrewer_all_schemes.json;palettable\\colorbrewer\\data\\" --add-data "C:/Users/iiMox/Desktop/Finale/NE1_LR_LC_SR_W_DR.tif;."  "C:/Users/iiMox/Desktop/Finale/program.py"

And here is the result of localtileserver.report() :

--------------------------------------------------------------------------------
  Date: Tue Jan 11 06:56:22 2022 Romance Standard Time       

                     OS : Windows
                 CPU(s) : 12
                Machine : AMD64
           Architecture : 64bit
                    RAM : 7.9 GiB
            Environment : Python
            File system : unknown

  Python 3.10.1 (tags/v3.10.1:2cd268a, Dec  6 2021, 19:10:37) [MSC v.1929 64
  bit (AMD64)]

        localtileserver : 0.4.0
                  flask : 2.0.2
          flask_caching : 1.10.1
            flask_restx : 0.5.1
               requests : 2.26.0
               werkzeug : 2.0.2
                  click : 8.0.3
                 scooby : 0.5.11
            large_image : 1.9.0
large_image_source_gdal : 1.9.0
             cachetools : 5.0.0
                    PIL : 8.4.0
                 psutil : 5.9.0
                  numpy : 1.21.4
             palettable : 3.3.0
                 pyproj : 3.3.0
             osgeo.gdal : 3.4.1
             ipyleaflet : 0.15.0
              traitlets : 5.1.1
                 folium : 0.12.1.post1
--------------------------------------------------------------------------------

@banesullivan
Copy link
Owner

I think your issue is really in regards to using GDAL with pyinstaller. A quick google revealed this: https://gis.stackexchange.com/a/295584

I don't know if I can be of much help with this... I'm not a Windows user and I've rarely used PyInstaller.

Bundling GDAL like this seems like a big task and this likely won't work if sharing the executable across computers

@iiMox
Copy link
Author

iiMox commented Jan 11, 2022

Can you recommend any other solutions rather than GDAL to perform this idea ?

@banesullivan
Copy link
Owner

GDAL is a core requirement of this package - there is no working around that

@banesullivan banesullivan changed the title large_image.exceptions.TileSourceError: No available tilesource Packaging with pyinstaller Jan 12, 2022
@banesullivan
Copy link
Owner

I have no idea how to bundle GDAL with pyinstaller and it's a bit out of scope for this project. Maybe one day, I can come back to this and add a page to the docs on how to do such a thing, but it will be rather involved and different on each OS.

I'm going to close this due to lack of activity and being a bit separate from the scope of this project. If someone else is interested in this, please feel free to revive this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants