diff --git a/pytorch_lightning/__init__.py b/pytorch_lightning/__init__.py index 41e458975d..0a4b96796d 100644 --- a/pytorch_lightning/__init__.py +++ b/pytorch_lightning/__init__.py @@ -60,4 +60,13 @@ else: 'Callback', 'data_loader' ] + + # necessary for regular bolts imports. Skip exception since bolts is not always installed + try: + from pytorch_lightning import bolts + except ImportError: + pass # __call__ = __all__ + +# for compatibility with namespace packages +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup.py b/setup.py index dfcaf29a59..9c878e50dd 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os from io import open # Always prefer setuptools over distutils -from setuptools import setup, find_packages +from setuptools import setup, find_namespace_packages try: import builtins @@ -57,7 +57,7 @@ setup( url=pytorch_lightning.__homepage__, download_url='https://github.com/PyTorchLightning/pytorch-lightning', license=pytorch_lightning.__license__, - packages=find_packages(exclude=['tests', 'tests/*', 'benchmarks']), + packages=find_namespace_packages(exclude=['tests', 'tests/*', 'benchmarks']), long_description=load_long_describtion(), long_description_content_type='text/markdown',