0

I'm currently researching subtree-related issues I added the B repository as a subtree to the A repository by creating a folder named B However, when importing modules from the subtree, I encounter import errors

The B repository has the following folder structure: B>C B>D

In a specific module in the C folder, I am trying to import a function called d from the init file in the D folder The code in the B repository uses the import statement "from D import d" However, when I try to import this in the A repository, I get an import error

It seems to be a simple problem, but I'm unable to solve it

I'm looking for a solution to include only specific folders in the top-level import statements, but I haven't found it yet I don't think testing it later will be a suitable solution

phd
  • 82,685
  • 13
  • 120
  • 165
james L
  • 11
  • 1
    I won't be able to help much because I do not have experience with subtrees... _but_ If you do not provide the git command and the error output in the question (please, _as text_), it will be hard for _anyone_ to be able to help at all. (oh, and welcome to SO!) – eftshift0 Jul 19 '23 at 09:22
  • Git commands hardly help here but the directory structure and some code are needed. [Edit] and add an [mcve] please. – phd Jul 19 '23 at 10:42
  • Also take into account the difference between absolute and relative import, explicit and implicit. See https://stackoverflow.com/a/12173406/7976758 , https://stackoverflow.com/search?q=%5Bpython%5D+absolute+relative+explicit+implicit+import – phd Jul 19 '23 at 10:45

0 Answers0