Dec-05-2018, 02:45 PM
(This post was last modified: Dec-05-2018, 02:45 PM by saisankalpj.)
parent/ __init__.py one/ __init__.py sample1.py two/ __init__.py sample.pyI have a structure like above.The code works fine in PYCHARM IDE.To run the program through command prompt,I have set environment variables like PYTHON_HOME,PATH variables.Now when i run the code througb command prompt,it doesnt run like
<c:/users/parent>python two\sample.py.The error which i get is like "No module named one",as sample.py file has an import like "from one.sample1 import *" But when i set PYTHONPATH variable and run the code same way it runs.
PYTHONPATH is set as c:/users/parent
How can i understand this.?Is it correct way to run the code through command prompt?.Please help me to understand this