Traceback ( most recent call last) when importing modules

Posted by subbu2687 on 2012-07-26 09:53

Hi,

I installed ActiveState ActivePython 2.7 (32 bit) in Windows 7 32 bit machine.

I created a sample module and when i tried to import it im getting the below error.

Traceback (most recent call last):
File "", line 1, in
import sample
File "C:\Python27\sample.py", line 1
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
^
SyntaxError: invalid syntax

I checked for previous solution.

1) Tried rebooting my machine
2) Changed the environment variable

But still the issue is not resolved.

Please help in resolving this issue.

Thanks!!

grahams
ActiveState Staff
Mon, 2012-08-13 12:49

The 2.7 documentation has a tutorial, with a section on modules.
http://docs.activestate.com/activepython/2.7/python/tutorial/modules.html

Walking through the tutorial may help you find what's going wrong.