Aug-31-2023, 12:28 PM
hi
I typed this thread before, but my net was disconnected and I lost it.
by the pic : https://drive.google.com/file/d/1Vwh-88B...drive_link
I wanted to import test2.py into goal.py.
D is my D drive on my PC. Because the names of folders and files are long I aliased them to simple letters.
I read in the web some suggestions for address:https://stackoverflow.com/questions/4383...ent-folder
and tried to do them, but after running goal.py in cmd each time, I received an error message like below :
my question:
Any guidance is appreciated.
I typed this thread before, but my net was disconnected and I lost it.
by the pic : https://drive.google.com/file/d/1Vwh-88B...drive_link
I wanted to import test2.py into goal.py.
D is my D drive on my PC. Because the names of folders and files are long I aliased them to simple letters.
I read in the web some suggestions for address:https://stackoverflow.com/questions/4383...ent-folder
and tried to do them, but after running goal.py in cmd each time, I received an error message like below :
Error:D:\..._module\Scripts>python.exe goal.py
Traceback (most recent call last):
File "D:\..._module\Scripts\goal.py", line 4, i
n <module>
from ... import *
ModuleNotFoundError: No module named 'test'
Explanation: As I said before I aliased the names of files and folders for simplicity. the ... in the above error is what I replaced with real names. the real goal file on my PC has several commented lines code which are the suggestions on the above site, but could not solve my problem and the file is very bad and messy, so I did not type (copy) here.my question:
- By attention to the pic, how can import test1 into goal.py
if __init__ .py in folder1 is nessary or not?
If folder1 is a virtual env(as it is for mine), is the answer to the first question different or not?
Any guidance is appreciated.