Today encountered a pit dad problem, find a half-day reason, finally solved, in this specially recorded.
Operating Environment: Windows Eclipse
I configured Python's runtime environment in eclipse to write Python code in eclipse.
Operation Steps:
1. In the Python interactive command line, enter import utils, no error;
2. In Eclipse's Pydev project, enter import utils, error: Unresolved import:utils
Workaround:
1.eclipse, click Window-preferences-pydev-interpreters-jython Interpreter, in libraries, click New Folder, add utils directory "src" Path, click "OK"
2. Restart Eclipse to resolve
Similarly, the following can be resolved:
1. In Project right-click on the Open menu, select properties-> Select "Pydev-interpreter/grammar" click the link "" Click here for configure an interpreter Not listed. "In the" Libraries "tab, click" New Folder ", join the Utils path, click" OK "
2. Restart Eclipse This method can be resolved in Eclipse Pydev, import times wrong: unresolved import
Python Learning note-import utils error