Python error: AttributeError: ‘module’ object has no attribute

When you import lib, you’re importing the package. The only file to get evaluated and run in this case is the 0 byte __init__.py in the lib directory. If you want access to your function, you can do something like this from lib.mod1 import mod1 and then run the mod12 function like so mod1.mod12(). If you want to be able to access mod1 when you … Read more

What is a Python egg?

Note: Egg packaging has been superseded by Wheel packaging. Same concept as a .jar file in Java, it is a .zip file with some metadata files renamed .egg, for distributing code as bundles. Specifically: The Internal Structure of Python Eggs A “Python egg” is a logical structure embodying the release of a specific version of a Python project, comprising its code, … Read more