hydroshare / hydroshare-jupyterhub

The HydroShare Jupyterhub Notebook Server is an environment designed provide added value to existing HydroShare resources via interactive computational notebooks.
4 stars 6 forks source link

Not able to access an installed Python package #143

Closed mroberge closed 5 years ago

mroberge commented 5 years ago

I tried to install a python package, hydrofunctions, from a Python 3 notebook using:

import sys
!{sys.executable} -m pip install hydrofunctions

The install went fine, with most of the requirements already met. When I checked on the package, it seemed fine:

!ls '/opt/conda/lib/python3.6/site-packages/hydrofunctions'

Everything was there. However, I wasn't able to import it:

import hydrofunctions as hf
hf.__version__

This just indicated that a package named hydrofunctions had been imported, but it was empty, so even the hf.__version__ hadn't been set during import. This was confirmed with dir(hf)

Thanks for any help you can provide!

mroberge commented 5 years ago

I figured out the problem! A year ago I had saved a file with the same name as the python package I was trying to import. My attempts to import the package instead imported the old file.