'importlib._bootstrap' has no attribute 'SourceLoader'

JPFrancoia picture JPFrancoia · Oct 27, 2015 · Viewed 18.2k times · Source

I'm trying to build an app with cx_freeze and esky. It was working before (ok, maybe some months ago. Since then, python 3.5 went out).

I have the following exception:

File "/usr/lib/python3.5/site-packages/esky/util.py", line 578, in compile_to_bytecode
    loader = importlib._bootstrap.SourceLoader()    
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceLoader'

I'm using:

  • Python 3.5.0
  • Esky 0.9.9 (latest) from pypi
  • cx_freeze 4.3.4-2

And I'm on Manjaro (Linux). I can not figure out where the problem comes from. Could you give me a hand please ?

Answer

Shingboo picture Shingboo · Nov 7, 2019

I was able to fix the issue by running:

pip3 uninstall setuptools
pip3 install setuptools