Reputation: 174
currently I need to make some distance calculation. For this I am trying the following on my ipython-notebook (version 4.0.4):
from geopy.distance import vincenty
ig_gruendau = (50.195883, 9.115557)
delphi = (49.99908,19.84481)
print(vincenty(ig_gruendau,delphi).miles)
Unfortunately I receive the following error when running the code above: ImportError: No module named 'geopy'
Since I am pretty new at python, I wonder how can I install this module (without admin rights) or what other simple options I do have for this calculations?
Thanks, ML
Upvotes: 14
Views: 62774
Reputation: 121
Double-check your interpreter settings.
Adding a potential solution below, especially for those running venvs through VS Code. A fresh VSC install put me back to square 1 with a number of "No Module Named" errors, which landed me on this thread.
My solution:
env/bin/activate
, poetry shell
, etc.Hope this helps--
Upvotes: 0
Reputation: 1
Even if you install using pip install
command you still have to use:
conda install -c conda-forge geopy
This command is in the anaconda server so that it gets installed in the anaconda.
Upvotes: 0
Reputation: 24812
You need to install the missing module in your python installation. So you have to run the command:
pip install geopy
in your terminal. If you don't have pip, you'll have to install it using:
easy_install pip
and if both command fail with Permission denied
, then you'll have to either launch the command as root:
sudo easy_install pip
sudo pip install geopy
or for pip, install it only for your user:
pip install geopy --user
And for future reference, whenever you get that kind of error:
ImportError: No module named 'XXXXX'
you can search for it on pypi using pip:
% pip search XXXXX
and in your case:
% pip search geopy
tornado-geopy (0.1.0) - tornado-geopy is an asynchronous version of the awesome geopy library.
geopy.jp (0.1.0) - Geocoding library for Python.
geopy.jp-2.7 (0.1.0) - Geocoding library for Python.
geopy (1.11.0) - Python Geocoding Toolbox
HTH
Upvotes: 21