User:StasFomin/AviSynth/Bugs/Pyscripter/No import from same directory
From Wiki4Intranet
< User:StasFomin | AviSynth | Bugs | Pyscripter
Issue: When Run/debug from PyScripter, it is impossible to import modules from same directory.
Consider two almost empty file python modules a.py and b.py in the same directory, a.py imports b.py.
- a.py successfully run in console, or from IDE, like Komodo IDE.
- In pyscripter, if working directory is not equal to directory of a.py we have «ImportError: No module named b»
I use «engine type=remote» and RPyc because of http://code.google.com/p/pyscripter/issues/detail?id=256, but I see same problem with internal debug engine.
Now I use ugly workaround:
import inspect, os curpath = os.path.dirname(inspect.getfile(inspect.currentframe())) sys.path.append(curpath)
but hope, that the issue can be fixed without it.
Any idea, what is wrong with me or PyScripter?
Thanks all in advance, Sincerely, Stas Fomin