14

I am trying to install the geopandas package with Anaconda Prompt, but after I use conda install geopandas an unexpected thing happened:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages

After this, it proceeds to search for conflicts, but hours pass without finishing. In the end, I still cannot use geopandas.

I have also tried installing geopandas in a different virtual environment and it works but I do not know how to use the environment in Jupyter Notebooks.

I would like to know, how can install geopandas without a separate environment?

Or, alternatively, how can I use geopandas in Jupyter Notebooks after install it in a separate environment?

merv
  • 67,214
  • 13
  • 180
  • 245
  • 3
    Looks like geopandas dependencies have conflict with existing versions of installed packages. Either downgrade/update the conflict packages or create a new conda env if you are interested in new conda environment refer here. https://medium.com/@nrk25693/how-to-add-your-conda-environment-to-your-jupyter-notebook-in-just-4-steps-abeab8b8d084 – Quantum Dreamer Mar 26 '20 at 15:02
  • What were the conflicts? Please share the content of your environment. – AMC Mar 30 '20 at 23:18

6 Answers6

15

Install it in a new env, and include ipykernel if you plan to use it in Jupyter:

conda create -n my_env geopandas ipykernel

Note, nb_conda_kernels should be installed install in your base env (i.e. where you launch Jupyter from). This enables Jupyter to automatically recognize other envs that are kernel-ready:

conda install -n base nb_conda_kernels
merv
  • 67,214
  • 13
  • 180
  • 245
2

If you want to install geopandas in an EXISTING environment, use conda-forge as follows:

conda install --channel conda-forge geopandas
Ken T
  • 2,255
  • 1
  • 23
  • 30
0

in my case, I installed geos firstly: pip install geos, then conda install geopandas and everything went through.

Max Feinberg
  • 810
  • 1
  • 6
  • 21
0

I faced the same problem. As far as I understand, my mistake was to install geopandas or pyproj with pip instead of conda. When trying to fix the issue (uninstalling geopandas, pyproj) I completely crashed my env.

I fixed the issue by completely reinstalling anaconda and creating a new separate conda env with an older version of python (python=3.8 instead of 3.9). Then everything ran smoothly.

neuhart
  • 21
  • 2
0

I had this issue when Jupyter had been installed from the default channel. For me running conda uninstall jupter followed by conda install -c conda-forge geopandas worked.

sam
  • 1,005
  • 1
  • 11
  • 24
-2

You can install geopandas with pip, however, geopandas requires other dependencies (such as pandas, fiona, shapely, pyproj, rtree). You need to make sure that they are properly installed. After that you should be able to use them in jupyter with a simple import geopandas.

Sileo
  • 307
  • 2
  • 18
  • 1
    I could install geopandas downloaded geopandas, shapely, GDAl, fiona, etc in wheel format. Then i sued pip as you reccomend and now i can use geopandas. – Santiago Cardona Urrea Mar 27 '20 at 16:55
  • 4
    @SantiagoCardonaUrrea I imagine that neither of you are aware of the particularities involved in using pip with Conda, see https://www.anaconda.com/using-pip-in-a-conda-environment/. – AMC Mar 30 '20 at 23:18
  • Whatever the case, This is the correct answer. Steps I followed. conda install geos shapely pyproj pip install fiona pip install geopandas – sushmit sarmah Aug 29 '22 at 14:07
  • I think it is not well-behaved method to have composite installation conda/pip. But I surely succeeded to use pip instead of conda for geopandas in my clean anaconda env which refuse to allow conda installation. During my try and error, I tried - specify conda-forge, broken channel - one by one installation of pre-requisites like pandas, pyrpoj etc... - clean conda env - clean Anaconda (reinstall) pyproj installation halts in similar reason of entire geopandas installation with conda. Good luck trouble shooters ! – omdit Jun 28 '23 at 07:03