0

I have a file structure that goes like this:

project
├── package1
│  └── useModule.py
└── package2 
   └── module.py

Basically, in package2 there are a bunch of files that do specific things such as Gets/Sets. I want to use one of the Gets from package2 in useModule.py in package1.

I have created an init.py file which allows me to use the module.py in the project directory but it does not seem to be working in the package1 directory.

I have used sys.path.append to add it to my python path and it works, but my IDE believes it to be an error as it just lights up red, it still does work. I would like to know if there were any other ways to do this without doing sys.path.append. Any ideas?

Thanks

King
  • 1
  • 1
  • Possible duplicate of [Relative imports for the billionth time](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time) – Axe319 Dec 19 '22 at 21:33

0 Answers0