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

new build of docker image throws error on rasterio import #105

Closed
jreiberkyle opened this issue Feb 27, 2020 · 1 comment · Fixed by #106
Closed

new build of docker image throws error on rasterio import #105

jreiberkyle opened this issue Feb 27, 2020 · 1 comment · Fixed by #106

Comments

@jreiberkyle
Copy link
Contributor

I am running docker for mac, which no longer provides docker-machine, the tool I was using to set my machine and build the docker images. When I rebuilt the docker image using docker for mac's default virtualization, I ran into the following error on rasterio import:

>$docker run -it planet-notebooks python -c "import rasterio"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/conda/lib/python3.7/site-packages/rasterio/__init__.py", line 22, in <module>
    from rasterio._base import gdal_version
ImportError: libpoppler.so.76: cannot open shared object file: No such file or directory
@jreiberkyle
Copy link
Contributor Author

I traced this to gdal being installed using the conda defaults channel, not the (specified) conda-forge channel. Evidence:

>$docker run -it planet-notebooks conda list gdal
# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
gdal                      3.0.2            py37hbb2a789_0    defaults
libgdal                   3.0.2                h27ab9cc_0    defaults

I have changed the conda install line in Dockerfile from

RUN conda install -y -c conda-forge --file /tmp/requirements.txt

to

RUN conda config --set channel_priority strict && \
    conda install -y -c conda-forge --file /tmp/requirements.txt

Now gdal is installed from the conda-forge channel

>4docker run -it planet-notebooks conda list gdal
# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
gdal                      3.0.4            py37hbb6b9fb_1    conda-forge
libgdal                   3.0.4                h022d3c0_1    conda-forge

No error is thrown when I run

docker run -it planet-notebooks:try2 python -c "import rasterio"

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

Successfully merging a pull request may close this issue.

1 participant