python - Occasional error of import matplotlib -


in newly created terminal, can import matplotlib no error. after working time in terminal, however, following happens:

python 2.7.5 (default, mar  9 2014, 22:15:05)  [gcc 4.2.1 compatible apple llvm 5.0 (clang-500.0.68)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import matplotlib usage: example.py torrentfile.torrent traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/matplotlib/__init__.py", line 134, in <module>     matplotlib.rcsetup import (defaultparams,   file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/matplotlib/rcsetup.py", line 19, in <module>     matplotlib.colors import is_color_like   file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/matplotlib/colors.py", line 54, in <module>     import matplotlib.cbook cbook   file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/matplotlib/cbook.py", line 15, in <module>     import new   file "new.py", line 12, in <module>     open(sys.argv[1], 'rb') fh: indexerror: list index out of range 

what's wrong?

with of @captainmurphy , @ironmanmark20, discovered new.py , new.pyc under ~/temp, shadows matplotlib files. after removing them, problem solved.


Comments