As you can see in screenshot i have one file queryconfig.py which have some methods which i want to use in my validate.py But I am not able to import this by 'from configs import queryconfig' What I am doing wrong ?
Asked
Active
Viewed 52 times
1
-
Welcome to SO. Please don't post screenshots. Post the code as `formatet text`. And also post the complete error message. – buhtz Jul 14 '22 at 12:38
-
Have you tried putting a . infront of configs as it's traversing into a sub directory? – Johnny John Boy Jul 14 '22 at 12:40
-
1I think this can help: https://stackoverflow.com/questions/43476403/importerror-no-module-named-something – theophile Jul 14 '22 at 12:41
-
yes i tried adding . but no effect – Johny Jul 14 '22 at 12:42
-
What's the PYTHONPATH for the project? – Klaus D. Jul 14 '22 at 12:45
-
1Does this answer your question? [ImportError: No module named
](https://stackoverflow.com/questions/43476403/importerror-no-module-named-something) – Ahmed AEK Jul 14 '22 at 12:54 -
@KlausD. C:\Users\uname\PycharmProjects\ref-data\srm-config-qa-test – Johny Jul 14 '22 at 13:14
-
You should add `arm-config` to it. – Klaus D. Jul 14 '22 at 13:51
-
@buhtz Lets not be dogmatic. It’s not *code*, it is a directory structure. A pic seems ok, though the output of the `tree` utility might be even better. – JL Peyret Jul 14 '22 at 15:49
-
1See https://stackoverflow.com/questions/14057464/relative-importing-modules-from-parent-folder-subfolder maybe use `..configs` ? I avoid relative imports myself so not sure. – JL Peyret Jul 14 '22 at 15:51