python - Problems in importing self-defined packages and modules? -
i using spyder.
i have started building project. architecture shown.
as shown, have 2 packages, 1 of has module called trajectorygeneration
now. both __init__.py
files automatically generated. trying import module main.py
, ended such error messages:
>>> generation import trajectorygeneration traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named generation
how may fix problem?
(spyder dev here) bug in spyder. not adding project's path pythonpath , that's why can't import project in console after open it. created issue , we'll fix in our next major release (i.e 2.3).
a workaround (as mentioned @jblasco) use our pythonpath manager add project's path yourself. after doing it, need open new console changes can take effect.
Comments
Post a Comment