You can use Vim's tab completion of filenames in conjuction with the **
recursive directory expansion.
e.g. type: :e libfoo/**/foo.py
and hit TAB. This will search down from the libfoo directory to find a file that matches. If there is more than one match you can cycle through them with the TAB key. When you find the one you want press enter to complete the command and edit the file.
For more about the ** matching do :h starstar
. It requires a version of Vim compiled with the +path_extra option.
If you have already edited the file once you can also search the buffers for partial name matches with the :b name
command. e.g. :b foo.py<TAB>
will expand to a buffer name that has 'foo.py' anywhere in it. N.B. it matches the entire path, so :b foo<TAB>
would match all buffers with files from the libfoo directory.