0

I was trying to import a py file in one of the files. The folder is A, and B and C are files inside that. I want to get C in B. I tried import C and from . import C. None of those worked. Any suggestions?

martineau
  • 112,593
  • 23
  • 157
  • 280
Wowz
  • 46
  • 6
  • 1
    You don't import a PY file, you import elements defined in that file. Can you be more clear about your file organization, and what you are trying to import? And finally, what error messages are you getting? – John Ladasky Jan 23 '22 at 01:41
  • It doesn't matter that `C` and `B` are in the same folder. What is relevant is what the current working directory (CWD) is when `B` is executing. How are you running `B`? Also see [Relative imports for the billionth time](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time). – martineau Jan 23 '22 at 02:08
  • @JohnLadasky Hi, Thanks for your response. I figures it out. Thanks for your help. – Wowz Jan 23 '22 at 03:47

0 Answers0