Suddenly unable to import pandas_market_calendars

  import, pandas, python-3.x

I have been running the same python script daily for some months & have not edited it recently.
As of today the import

import pandas_market_calendars as market_calendars

Fails with error in the file:

<>venvlibsite-packagespkg_resources.py
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module ‘importlib._bootstrap’ has no attribute ‘SourceFileLoader’

The offending lines of pkg_resources.py are:

register_loader_type(type(None), DefaultProvider)
if importlib_bootstrap is not None:
   register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)

Is there a work-around please?

Source: Python-3x Questions

LEAVE A COMMENT