Logo MutantMahesh
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Tags
  • access
  • custom
  • drupal
  • entity
  • filter
  • import
  • menu
  • plugin
  • python
  • terminal
  • tmux
  • views
Hero Image
How to fix import error with current package relative import

Problem ImportError: attempted relative import with no known parent package If you are developing a python package and try to import a module from the current package using relative path, you may get the following error. from .docdb_json_importer import DocDbJsonImporter OR from . import utils ImportError: attempted relative import with no known parent package For example in my case I was developing a package called docdb-import-export and I was trying to import a module from the current package using relative path like this:

September 5, 2023 Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Recent Posts
Contact me:
  • msankhala
  • Mahesh Sankhala

© 2023 Copyright.