Date
1 - 2 of 2
concurrent.futures errors running rio mbtiles on Windows
Sean Gillies
Hi Matt, I'm sorry that you're having trouble. We don't test rigorously on Windows and so it's not surprising that some aspects of rasterio aren't correct. If we execute the tiler as `rio mbtiles`, the __main__ module is generated by setuptools and my understanding is that this hides, on Windows, imports needed by workers. Could you try adding, after https://github.com/mapbox/rio-mbtiles/blob/main/mbtiles/scripts/cli.py#L600, the following block? if __name__ == "__main__": mbtiles() And then try executing the program not as a rio plugin, but as python -m mbtiles.scripts.cli ... ? On Mon, Oct 11, 2021 at 11:36 AM Gregory, Matthew <matt.gregory@...> wrote: Hi all, --
Sean Gillies |
|
Gregory, Matthew
Hi all,
Preface this by saying I know next to nothing about multiprocessing and my debugging skills are failing me. I'm trying to run a simple rio mbtiles command on Windows (Python 3.8, rasterio 1.2.9, rio_mbtiles 1.6.0) with a small test GeoTiff in Web Mercator using this syntax: > rio mbtiles --resampling average --zoom-levels 5..8 --format PNG -j 4 --progress-bar test.tif test.mbtiles I often get this error stack trace: """ File "c:\users\gregorma\envs\default-38\lib\site-packages\mbtiles\cf.py", line 62, in process_tiles tile, contents = future.result() File "c:\users\gregorma\appdata\local\programs\python\python38\ lib\concurrent\futures\_base.py", line 432, in result return self.__get_result() File "c:\users\gregorma\appdata\local\programs\python\python38\ lib\concurrent\futures\_base.py", line 388, in __get_result raise self._exception concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending. """ I can set up the same environment using WSL (Debian) and run the same command and it works flawlessly. I don't think it's relevant but I'm using virtualenvs on both Windows and WSL. I've read numerous posts about including either the if __name__ == "__main__" guard or (with multiprocessing) using freeze_support for helping with these issues on Windows, but have no idea where these would be inserted for this command (either at rio itself or within any of the plugins that use concurrent.futures). Has anyone had luck running rio mbtiles on a Windows box? I obviously have the WSL workaround if needed. Please let me know if more information is needed. Thanks for any advice, matt |
|