python - Using Numpy from keyword.py -


i want use numpy in python script uses pandas process excel file. however, 1 of constraints file must named keyword.py, causes import error. import error traced line from keyword import iskeyword _iskeyword in c:\python27\lib\collections.py, assume causes error because own keyword.py overriding default keyword module. there way avoid collision?

not pretty, keyword.py of

if true:      import imp, sys       keyword_loc = imp.find_module("keyword", sys.path[1:])[1]      imp.load_source("keyword", keyword_loc)  import collections print(collections.counter) 

fails attributeerror if replace true false, gives me

(2.7) dsm@notebook:~/coding/kw$ python keyword.py  <class 'collections.counter'> 

as is. works finding out original keyword library , manually importing it. after this, following attempts import keyword see it's there.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -