Cannot import class from local modules in python

前端 未结 2 1474
梦如初夏
梦如初夏 2021-01-27 11:57

I have a module parser.py in local directory with

class Parser(object):
    . . . .
    . . . . 

class Parser2(object):
    . . . .
    . . . . 
2条回答
  •  花落未央
    2021-01-27 12:38

    check your sys.path. if /usr/lib/pythonX/lib-dynload is before '' you will be importing the official parser module from the standard library instead of your module.

提交回复
热议问题