ModuleNotFoundError, even though I can see module in dist-packages folder, Setuptools / EGG issue?

John Ladasky john_ladasky at sbcglobal.net
Wed Apr 8 13:47:20 EDT 2020


Hi folks,

Something broke in my Python installation in the past two or three days.  I'm working in Ubuntu 19.10 and Python 3.7, without virtual environments.  

I have two modules of Python source code that I am developing.  I regularly change this code and "distribute" it to myself using setuptools.  From the command prompt in the module's base folder, I execute:

  python3 setup.py sdist
  sudo python3 setup.py install

That process has been working for me for years.  But after recent rebuilds, when I try to import those modules today, I get ModuleNotFoundErrors for each of them.  I tried importing other modules that were installed by pip3.  They work fine.

I looked in /usr/local/lib/python3.7/dist-packages.  The one thing that is unique to my two packages is the .egg extension at the end of the file names.  Oddly, one of the two modules is a single .egg archive file, and the other is a normal folder with folders inside it, despite the .egg extension in the name.

A third package of mine which I did not build recently appears as a normal sub-folder within dist-packages, and it imports correctly.

What is setuptools supposed to do?  Why has its behavior apparently changed?  Hope someone can offer some advice.  Thanks.


More information about the Python-list mailing list