another file in another directoryimport spam to make this workyou'll have to configure your module search path one way or another to include the directory containing spam py here are few tips on this process using pythonpath as an exampledo the same for other settings like path as needed (though can set path automaticallysee appendix bunix/linux shell variables on unix systemsthe way to set environment variables depends on the shell you use under the csh shellyou might add line like the following in your cshrc or login file to set the python module search pathsetenv pythonpath /usr/home/pycode/utilities:/usr/lib/pycode/package this tells python to look for imported modules in two user-defined directories alternativelyif you're using the ksh shellthe setting might instead appear in your kshrc file and look like thisexport pythonpath="/usr/home/pycode/utilities:/usr/lib/pycode/package other shells may use different (but analogoussyntax dos variables (and older windowsif you are using ms-dos or some now fairly old flavors of windowsyou may need to add an environment variable configuration command to your :\autoexec bat fileand reboot your machine for the changes to take effect the configuration command on such machines has syntax unique to dosset pythonpath= :\pycode\utilities; :\pycode\package you can type such command in dos console windowtoobut the setting will then be active only for that one console window changing your bat file makes the change permanent and global to all programsthough this technique has been superseded in recent years by that described in the next section windows environment variable gui on all recent versions of windows (including xpvista and )you can instead set pythonpath and other variables via the system environment variable gui without having to edit filestype command linesor reboot select the control panel (in your start button in windows and earlierand in the desktop mode' settings "charmon windows )choose the system iconpick the advanced settings tab or linkand click the environment variables button at the bottom to edit or add new variables (python path is usually new user variableuse the same variable name and values syntax appendix ainstallation and configuration