Install of local python library created using nbdev cannot be found

232 views Asked by At

I am creating a library using nbdev. Following the instructions here.

My file structure is the same as given in the instructions, with the library installed at top level of the repo and the notebooks in the 'nbs' folder

repo folder
|_ settings.ini
|_ setup.py
|_ nbs
|_ library folder
|_ etc

After creating the library. You are supposed to install the library using pip install -e .. When I do this I see the dependencies checks passing and get a message saying installation is successful.

However, when I open a notebook inside the nbs folder and try and import the library using

from pyseatrials.trig import *

I get the error message No module named 'pyseatrials'

However, if I create a new notebook in the top level of the repo the import is sucessful. The same occurs if I use the terminal

python3
from seatrials import *

However any other directory produces the 'not found' error. In addition the library does not show up on pip list

This this is not the behaviour I was expecting after reading the instructions or watching the introduction video.

I am using

  • pip 22.3
  • python 3.9
  • Ubuntu 20.04.4 LTS

How do I fix the import issue and what is going on?

1

There are 1 answers

0
Jonno Bourne On

I ended up getting around the issue by installing direct from git using

python -m pip install git+<URL to library repo>

It isn't the best approach but it does work