Aaron de Windt Aaron de Windt - 1 month ago 18
Python Question

How do I check if a directory is a python package?

If I want to check whether a directory is a python package, is it enough to check whether a directory contains a

__init__.py
file?

Answer Source

Before Python 3.3, only directories containing __init__.py files were considered packages (see regular package in Glossary).

Since the addition of namespace packages in Python 3.3, every directory is a Python package, technically.