I am working with Eclipse Kepler(2013) and python 3.3.2 and running a simple import like
import glob
a = glob.glob('*')
print(a)
gives a:
TypeError: 'module' object is not callable
This is not the case if I run the same code in Idle. I know I am missing something.
Any help is appreciated.
In some cases people end up using same file name as built in modules. Don't name your file as "glob.py".
What worked for me was i changed import glob
to from glob import glob
at the top of the file.
Probably in your Eclipse environment there's a module named glob
that gets imported before the standard library one.
Try printing the glob.__file__
to check it out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With