Proper relative imports: “Unable to import module”

前端 未结 4 1724
南方客
南方客 2021-02-12 11:34

I have a project structured like this:

.
└── myapp
    ├── app.py
    ├── models
    │   ├── hello.py
    │   └── world.py
    └── requirements.txt
4条回答
  •  伪装坚强ぢ
    2021-02-12 12:17

    The error is coming from pylint. You need to add this line into settings.json file (VS Code):

    "python.linting.pylintArgs": ["--init-hook",
            "import sys; sys.path.append('')"],
    

提交回复
热议问题