简体   繁体   中英

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?

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 (ie where you launch Jupyter from). This enables Jupyter to automatically recognize other envs that are kernel-ready:

conda install -n base nb_conda_kernels

在我的情况,我安装geos首先: pip install geos ,然后conda install geopandas ,一切都通过。

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

conda install --channel conda-forge geopandas

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM