I have a Python project with the layout
setup.py
foobar/
__init__.py
foo.py
bar/
__init__.py
Where the foobar/__init__.py
reads
from . import foo
from . import bar
and setup.py
from setuptools import setup
setup(
name='foobar',
version='0.0.1',
packages=['foobar'],
)
When doing import foobar
from the source directory, it all works as expected. However, when installing the package via pip install .
, the subfolder bar/
is not installed, leading to the import error
ImportError: cannot import name bar
Any hints?