Santiago Cardona Urrea
Santiago Cardona Urrea

Reputation: 313

Can't install geopandas in Anaconda environment

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?

Upvotes: 15

Views: 23167

Answers (6)

SBUK-Tech
SBUK-Tech

Reputation: 1327

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.

Upvotes: 0

neuhart
neuhart

Reputation: 21

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.

Upvotes: 0

Ken T
Ken T

Reputation: 2553

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

conda install --channel conda-forge geopandas

Upvotes: 3

Jason Q
Jason Q

Reputation: 1

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

Upvotes: 0

merv
merv

Reputation: 76720

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

Upvotes: 16

Sileo
Sileo

Reputation: 295

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.

Upvotes: -3

Related Questions