Stücke
Stücke

Reputation: 993

ModuleNotFoundError despite package installation

For an unknown reason, some functions of the Python package GeoPandas were not working on my PC any more. I therefore deinstalled and reinstalled Anaconda and also installed the Python package GeoPandas via conda create -n geo-env -c conda-forge geopandas which is now check-marked as installed in the Anaconda package overview.

enter image description here

However, when I run import geopandas in Spyder I receive the following error:

runfile('untitled0.py', wdir='/Downloads')
Traceback (most recent call last):

  File "untitled0.py", line 1, in <module>
    import geopandas

ModuleNotFoundError: No module named 'geopandas'

Does anyone have an idea what I can do? I made sure I am running the correct Anaconda environment.

enter image description here

Upvotes: 0

Views: 66

Answers (1)

wombat
wombat

Reputation: 698

Not familiar with Spyder and haven't used Anaconda much, but I got curious. The first thing is that you want to install the Spyder-kernel as described here in your geo-env environment (you might already have done that). Great, all done, you load up Spyder, change your runtime to the correct python in your environment and... It doesn't work.

From my testing, Spyder is not very dynamic, so I had to restart Spyder once I had set it up to the correct environment. On restart, you will notice that the iPython window attempts to load the kernel and then it will work.

Upvotes: 1

Related Questions