1

I have a problem trying to import GeoPandas. Since it was impossible to install the package in the normal channels within Anaconda, because of possible incompatibility with other spatial packages, I create a new channel called geo_envas it was sugested in other chats, as follows:

conda create -n geo_env
conda activate geo_env
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install python=3 geopandas

by this way it was possible to install successfully Geopandas, however, now I have a mixing of environments and by importing geopandas as pdg I get:

import geopandas as gpd
Traceback (most recent call last):

  File "<ipython-input-28-a62d01c1d62e>", line 1, in <module>
    import geopandas as gpd

ModuleNotFoundError: No module named 'geopandas'

and even if I apply

python -c "import geopandas; print(geopandas.version)"

Now, I feel that I see the end of the path!! I have not idea now how to make this work, and I really need Geopandas installed for some spatial analysis. Important to be mentioned, that I also have installed shapely and fiona. Both of these are sometimes recommended to have installed before Geopandas.

  • 2
    Just install your required packages at the same time you install geopandas and let conda figure it out, i.e conda install python=3 geopandas shapely fiona some_package something_else another yet_another. Don't try and mix your envs, just create a new one and use that. – user2856 Mar 14 at 0:55
  • 2
    You are likely trying to import geopandas in different env than geo_dev. Make sure you are using the correct environment. – martinfleis Mar 14 at 15:56
  • Thanks, the problem now as I see is that the environment geo_env does not have spyder installed: channel url: https://conda.anaconda.org/geo_env error code: 404. However, some how it is no possible to do it. I do not know yet the reason. This after that I have already activated geo_env. – Vlad Mar 16 at 4:33
  • To solve the problem, I eliminated unnecessary channels, I set the defaults as the highest priority, after that the process looks better. – Vlad Mar 21 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.