- ImportError: attempted relative import with no known parent package
- ModuleNotFoundError: No module named ‘views’
please give me suggestion
please give me suggestion
When attempting a relative import in Python, you may encounter an error message that says “attempted relative import with no known parent package.” This error message is usually triggered when you are trying to import a module from a package using a relative import, but the package’s name is not recognized by Python as a valid package.
To fix this error, you need to make sure that the module being imported is part of a package, and that the package is on the Python path. You can do this by adding an empty init.py file to the package’s directory, and by making sure that the directory containing the package is on the Python path.
Also, you can try one or more of the following solutions: