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

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

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

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


        
11条回答
  •  萌比男神i
    2020-11-29 05:02

    My usual trick is to simply print sys.path in the actual context where the import problem happens. In your case it'd seem that the place for the print is in /home/hughdbrown/.local/bin/pserve . Then check dirs & files in the places that path shows..

    You do that by first having:

    import sys
    

    and in python 2 with print expression:

    print sys.path
    

    or in python 3 with the print function:

    print(sys.path)
    

提交回复
热议问题