Why am I getting the following error in Python "ImportError: No module named py"? -


I am a Python newbie, so bear with me :)

I tested a file. The py content is as follows:

  test.py Import sys print sys.platform print 2 ** 100  

Then I went to import In order to follow an example in your book, when I do this, I get output with an import error when I do the test.py file in the interpreter.

  win32 1267650600228229401496703205376 Tracebacks (most recent call final): File "& lt; stdin>", line 1, & lt; Module & gt; ImportError: named a module py  

Why did I get this error and how do I fix it? Thanks!

instead:

  check at import.py  

Simply write:

  import test  

assumes that the test.py is in the same directory, as The file does import it.


Comments