import error: 'No module named' *does* exist

前端 未结 11 1697
星月不相逢
星月不相逢 2020-11-29 04:30

I am getting this stack trace when I start pyramid pserve:

% python $(which pserve) ../etc/development.ini
Traceback         


        
11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 05:08

    I met the same problem, and I try the pdb.set_trace() before the error line.

    My problem is the package name duplicate with the module name, like:

    test
    ├── __init__.py
    ├── a
    │   ├── __init__.py
    │   └── test.py
    └── b
        └── __init__.py
    

    and at file a/__init__.py, using from test.b import xxx will cause ImportError: No module named b.

提交回复
热议问题