earthlab/earthpy

ModuleNotFoundError: No module named 'earthpy'

beammieb opened this issue · 3 comments

Hi there, i have looked everywhere for a solution before coming here:

When I try to import earthpy on jupyter, it tells me ModuleNotFoundError: No module named 'earthpy'

I am trying to import earthpy and use et.io.HOME to get directory path as described in this course: https://www.earthdatascience.org/courses/intro-to-earth-data-science/python-code-fundamentals/work-with-files-directories-paths-in-python/set-working-directory-os-package/

I got stuck here and wish to resolve it so that I can proceed with the reading.

Please assist with any resource.

NB:
i. earthpy was installed using conda
ii. I have activated the earth-analytics-python-env environment in the prescribed earth-analytics directory but I am unable to import earthpy
iii. below is my environment.yml structure:
name: earth-analytics-python
channels:

  • conda-forge
  • defaults

dependencies:

  • python=3.7
  • pip

Core scientific python

  • numpy
  • matplotlib
  • pyqt
  • seaborn
  • tqdm
  • kiwisolver

Spatial packages

#- rasterio

  • pysal
  • pyproj
  • rasterstats
  • geopy
  • cartopy
    #- geopandas
  • contextily
    ** - earthpy**
  • folium
  • geojson
  • mapboxgl
  • hydrofunctions
  • geocoder
  • tweepy
  • xarray
  • scipy

Natural language processing

  • nltk
  • textblob

Jupyter Environment

  • papermill
  • autopep8
  • jupyterlab
  • notebook
  • ipython
  • jupyter_contrib_nbextensions
  • nbclean

Autograding

  • matplotcheck>=0.1.2
  • nbgrader

Thank you.

hey @beammieb

  1. how do you launch jupyter? Do you first activate the environment and then run jupyter notebook right after (this will make the ea-python environment active).

  2. When you activate the environment and run conda list is earthpy there?

  3. in jupyter you can also open up a terminal to check your environment. Have you done this before? if you have you can do that and run conda list to ensure earthpy is there.

if you can print the output of conda list with your environment activated this might be a good start!

Hi @lwasser,

Thank you for your time and apologies for my previous live Pull Request.

These are my observations:

i. As you mentioned in item 1, I activated the environment using bash, ran conda list from bash; I found earthpy on the list of packages from bash then I opened terminal on jupyter notebook and ran conda list and also found earthpy there. However, i could not run import earthpy from my notebook; it always comes back with "No module named earthpy, even if conda list showed it.

ii, I could not also activate the environment from within jupiter terminal.

Thank you.

hey @beammieb you may have figured this out but today i had a student with a similar issue. when they ran which python at the command line, they had miniconda and anaconda both installed. anaconda was the main pythhon but miniconda was where their envt was.

so my guess is that your issue is not an earthpy issue. it's an envt issue. it def makes sense to close this issue given this!! the solution for her would be to uninstall anaconda! and make sure $ which python returns a miniconda path