Python error: AttributeError: 'module' object has no attribute

前端 未结 4 1280
梦如初夏
梦如初夏 2020-11-29 07:15

I\'m totally new to Python and I know this question was asked many times, but unfortunately it seems that my situation is a bit different... I have created a package (or so

4条回答
  •  猫巷女王i
    2020-11-29 07:55

    My solution is put those imports in __init__.py of lib:

    in file: __init__.py
    import mod1
    

    Then,

    import lib
    lib.mod1
    

    would work fine.

提交回复
热议问题