Why “import somemodule” fails?
• The error message should tell you what is wrong. • Maybe you typed wrong name. Python is Case Sensitive. Check the module (script) name. • Check your sys.path setting. >>> import sys >>> sys.path If your module is not in the direcotry list of sys.path, you can append the module’s directory to sys.path >>> sys.path.append(r’\yourDirectory\subdirectroy’) You may move your module into sys.path directroy • Maybe the module ( or scrript ) has some errors.
Related Questions
- My firewall starts and restarts fine but if I try shorewall restore, the script fails because none of my shell variables from /etc/shorewall/params are set. Why?
- If the installation fails, was there a prior installation attempt? Was the MS$FG8 folder removed before attempting to install again?
- What happens if a program fails to submit a Self Report?