0

My folder structure is:

/mfolder/A/parent.py

/mfolder/A/test/child.py

I want to import parent.py file into child.py file. But I'm getting this error

ImportError: No module named test

(Note: I've set the PYTHONPATH up to /mfolder and have __init__.py in test) How to solve it?? Thanks in advance

rollstuhlfahrer
  • 3,988
  • 9
  • 25
  • 38
  • possible duplicate of [importing modules from parent folder](https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder) and [import file from parent directory](https://stackoverflow.com/questions/16780014/import-file-from-parent-directory/30536516) – IMCoins Jan 17 '18 at 09:52
  • 5
    Possible duplicate of [Importing modules from parent folder](https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder) – Sudheesh Singanamalla Jan 17 '18 at 09:53
  • Please post the traceback and relevant code. – bruno desthuilliers Jan 17 '18 at 09:57
  • Does this answer your question? [Import file from parent directory?](https://stackoverflow.com/questions/16780014/import-file-from-parent-directory) – gfaster Mar 08 '21 at 16:54

0 Answers0