Home > OS >  How do I add the path to python for vscode
How do I add the path to python for vscode

Time:09-04

My util.py file is sited at the same directory with views.py, why do I still have the ImportError:

ImportError

CodePudding user response:

Try to use this

from .utils import _function_or_class_name_

or

from .utils import *

CodePudding user response:

Seems to me in the picture that the file is in the same folder just do a regular import

from util import function_or_class_name

or just import the file

import util
  • Related