question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to install geopandas with numexpr and bottleneck using conda

See original GitHub issue

I have trouble installing a clean miniconda environment + geopandas as per the official docs.

My problem is that even though I was able to install geopandas on it’s own, the moment I add the numexpr and bottleneck accelerator libraries, conda goes into a crazy mode and adds different packages from incompatible sources and the whole system ends up broken, with fiona / ImportError: libpoppler.so lines.

Now that many new changes have been implemented in conda, for example strict channel priority, I don’t know what is the right way to install geopandas from conda-forge.

My question is what is the right command sequence to install a clean geopandas environment with a miniconda install for Python 3.7?

So far here is my script (from a Dockerfile), which is gets broken if numexpr and bottleneck is included.

COPY config/.condarc /root/.condarc

RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh && \
    ln -s /opt/conda/bin/conda /usr/bin/conda && \
    ln -s /opt/conda/bin/python /usr/bin/condapy && \
    ln -s /opt/conda/bin/pip /usr/bin/condapip && \
    conda update -y --all && \
    conda install -c conda-forge geopandas numexpr bottleneck && \
    conda clean -y --all

.condarc

channels:
  - conda-forge
  - defaults

auto_update_conda: false

What kind of changes are needed to make this work on a recent conda install?

Especially, I’m not sure about the following parts:

  • Do I need .condarc, or I can run conda-config commands after install?
  • If I really don’t want anything from the defaults channel, can I just remove it?
  • Can I remove defaults it by simply not listing it in .condarc, or I need to run a conda config --remove channels defaults command?
  • How can I insert strict channel priority into the above script?

Note: I also opened a SO question, as it might be a better place, feel free to answer over there if you deem it better https://stackoverflow.com/questions/54797185/how-to-install-geopandas-with-numexpr-and-bottleneck-using-conda

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
hyperknotcommented, Feb 22, 2019

Thanks a lot for the answers, here is what I came up with, for a purpose-built environment, where defaults channel can be removed.

  1. (Optional) Install miniconda
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh
  1. Add conda-forge and remove defaults:
conda config --add channels conda-forge
conda config --remove channels defaults
  1. Update conda and core modules to use conda-forge:
conda update conda -y
conda update -y --all
  1. Install geopandas, numexpr, bottleneck, using conda-forge
conda install geopandas numexpr bottleneck
  1. Clean caches if needed (for example in Dockerfile):
conda clean -y --all

Dockerfile “one liner”:

RUN wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh && \
    ln -s /opt/conda/bin/conda /usr/bin/conda && \
    ln -s /opt/conda/bin/python /usr/bin/condapy && \
    ln -s /opt/conda/bin/pip /usr/bin/condapip && \
    conda config --add channels conda-forge && \
    conda config --remove channels defaults && \
    conda update conda -y && \
    conda update -y --all && \
    conda install \
        geopandas numexpr bottleneck && \
    conda clean -y --all
1reaction
jorisvandenbosschecommented, Feb 21, 2019

Conclusion: I really need to update the installation docs … 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation — GeoPandas 0.12.2+0.gefcb367.dirty ...
To install GeoPandas and all its dependencies, we recommend to use the conda package manager. This can be obtained by installing the Anaconda...
Read more >
Trying to download geopandas using conda. Receiving an ...
Then use conda install -c conda-forge geopandas pycurl . This allows conda to resolve the possible conflict and get both packages installed. – ......
Read more >
conda install geopandas failed with initial frozen solve
I am trying to install the geopandas package with Anaconda Prompt, but after I use conda install geopandas an unexpected thing happened: Collecting...
Read more >
Check pandas version: pd.show_versions - nkmk note
... for how to check the version of installed pandas with pip command. ... 2018.3 # blosc: None # bottleneck: None # tables:...
Read more >
15.0 in a Jupyter Notebook Docker image, and a 'pycosat ...
The conda install definitely adds 'pycosat': ... cython sqlalchemy astropy pandas numexpr bottleneck h5py pyyaml (and nomkl on linux).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found