Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I've installed geopy but it says ImportError: No module named geopy

I've installed geopy with

pip install geopy

I've checked on my command line, and it's there.

BUT whenever I try to use it, either in Anaconda, PyCharm or Jupiter Notebooks, I get:

ImportError: No module named geopy

I've had similar problems in the past with other libraries. I've used PyCharm and Anaconda at different times, and I'm sure that I have more than one Python version running on my computer. I don't know if this might be the reason this is happening.

like image 691
Spartakus Avatar asked Jan 20 '26 18:01

Spartakus


2 Answers

Thanks! I was indeed running the code on a different environment than the one I had installed the package in.

like image 133
Spartakus Avatar answered Jan 22 '26 07:01

Spartakus


If you are using some specific environment with conda, make sure you activate the environment

>> source activate Envname

and then after the environment is active then install the package

>> pip install geopy

I guess you are not

  1. Installing the geopy inside the environment, and then trying to access the package after activating the environment OR
  2. Installed inside the environment but not activating the environment and trying to access the package.
like image 21
Sundeep Avatar answered Jan 22 '26 06:01

Sundeep



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!