Tuesday, July 24, 2007

restart python to get newly imported module

newly imported python module by using easy_install can not be imported instantly. you have to restart the python session to import the new module properly
C:\Documents and Settings\mwang>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
>>> import MySQLdb
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named MySQLdb
>>> quit
Use quit() or Ctrl-Z plus Return to exit
>>> quit()

C:\Documents and Settings\mwang>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>

No comments: