Search code examples
pythonmacosgeopy

No module named 'geopy' but works in terminal


I'm trying to run a python program within pyCharm but I get this error:

Traceback (most recent call last): File "/Users/amywang/Documents/latLong/main.py", line 3, in from geopy.geocoders import Nominatim ImportError: No module named 'geopy'

However, when I run the same import statement in terminal I don't get an error.

enter image description here

Any ideas on how I can resolve this? Thanks!


Solution

  • It sounds like you need to update the preferences of the PyCharm project to point to the correct python interpreter.

    Preferences -> Project:SomeProject -> Project Interpreter.