Invenio-Base
raw JSON → 2.4.0 verified Fri May 01 auth: no python
Base package for building Invenio application factories. Provides foundational utilities such as configuration loading, instance path setup, logging configuration, and Flask application factory. Current version 2.4.0, requires Python >=3.7. Invenio-Base follows semantic versioning with a stable release cadence.
pip install invenio-base Common errors
error TypeError: create_app() missing 1 required positional argument: 'app_class' ↓
cause Calling create_app() without the mandatory app_class argument.
fix
Call create_app with your InvenioBase subclass: create_app(MyApp).
error AttributeError: module 'invenio_base' has no attribute 'Base' ↓
cause Wrong import path; Base class is named InvenioBase.
fix
Use 'from invenio_base import InvenioBase' instead of 'from invenio_base import Base'.
error ModuleNotFoundError: No module named 'invenio_base.helpers' ↓
cause The helpers submodule was removed in invenio-base 2.0.0.
fix
Remove import of invenio_base.helpers or update code to use other utilities.
Warnings
breaking Invenio-Base dropped support for Python 3.6 and earlier. Requires Python >=3.7. ↓
fix Upgrade Python to 3.7+ or pin to invenio-base<2.0.0 if stuck on Python 2.7/3.6.
breaking Invenio-Base 2.0.0 removed the deprecated invenio_base.helpers module. Code depending on helpers must be updated. ↓
fix Remove imports from invenio_base.helpers; use standard library or Flask helpers instead.
gotcha The create_app function requires an InvenioBase subclass, not an instance. Passing an instance will raise a TypeError. ↓
fix Ensure you pass the class (not an instance) to create_app.
Imports
- InvenioBase wrong
from invenio_base import Basecorrectfrom invenio_base import InvenioBase - create_app wrong
from invenio_base import create_appcorrectfrom invenio_base.app import create_app
Quickstart
from invenio_base.app import create_app
from invenio_base import InvenioBase
class MyApp(InvenioBase):
pass
app = create_app(MyApp)
if __name__ == '__main__':
app.run()