<div dir="ltr">Do you have a file called `tempfile.py` in the directory you are running the script from?<div><br></div><div>The issue is that the module `tempfile` (which should be coming from the standard library) is reporting that it does not have an expected member (TemporaryFile).   If you are shadowing that module with a local file you will see exceptions like this.  The other option is that you python installation is broken.</div><div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Aug 5, 2017 at 12:36 PM Pooja <<a href="mailto:poojabhalode11@gmail.com">poojabhalode11@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have been working on a piece of code and suddenly getting these errors:<br>
/Users/poojabhalode/.bash_profile: line 1: .bashrc: No such file or<br>
directory<br>
[[ 2 -1  0]<br>
 [-1  2 -1]<br>
 [ 0 -1  2]]<br>
[[  3.41421356e+00   8.32667268e-17  -6.37995760e-17]<br>
 [  0.00000000e+00   2.00000000e+00   1.35170527e-16]<br>
 [  0.00000000e+00   0.00000000e+00   5.85786438e-01]]<br>
8.32667268469e-17<br>
8.32667268469e-17<br>
-6.37995760397e-17<br>
0.0<br>
1.35170526715e-16<br>
0.0<br>
0.0<br>
[[ 3.41421356  0.          0.        ]<br>
 [ 0.          2.          0.        ]<br>
 [ 0.          0.          0.58578644]]<br>
Traceback (most recent call last):<br>
  File "/Users/poojabhalode/Google Drive/PYTHON/files/1sttest/May17.py",<br>
line 7, in <module><br>
    import matplotlib<br>
  File<br>
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",<br>
line 947, in <module><br>
    rcParams = rc_params()<br>
  File<br>
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",<br>
line 856, in rc_params<br>
    fname = matplotlib_fname()<br>
  File<br>
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",<br>
line 726, in matplotlib_fname<br>
    configdir = _get_configdir()<br>
  File<br>
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",<br>
line 597, in _get_configdir<br>
    return _get_config_or_cache_dir(_get_xdg_config_dir())<br>
  File<br>
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",<br>
line 566, in _get_config_or_cache_dir<br>
    if not _is_writable_dir(p):<br>
  File<br>
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",<br>
line 228, in _is_writable_dir<br>
    t = tempfile.TemporaryFile(dir=p)<br>
AttributeError: 'module' object has no attribute 'TemporaryFile'<br>
[Finished in 0.2s with exit code 1]<br>
[shell_cmd: python -u "/Users/poojabhalode/Google<br>
Drive/PYTHON/files/1sttest/May17.py"]<br>
[dir: /Users/poojabhalode/Google Drive/PYTHON/files/1sttest]<br>
[path: /usr/bin:/bin:/usr/sbin:/sbin]<br>
<br>
<br>
My code gives errors at the import statement itself:<br>
<br>
Code::<br>
import matplotlib<br>
ERROR indicated here.<br>
matplotlib.use("TkAgg")<br>
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,<br>
NavigationToolbar2TkAgg<br>
from matplotlib.figure import Figure<br>
<br>
Can someone please let me know what is going wrong with this?<br>
Thank you. I would really appreciate it.<br>
<br>
Thanks!<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://matplotlib.1069221.n5.nabble.com/Matplotlib-tkinter-error-tp48051.html" rel="noreferrer" target="_blank">http://matplotlib.1069221.n5.nabble.com/Matplotlib-tkinter-error-tp48051.html</a><br>
Sent from the matplotlib - users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Matplotlib-users mailing list<br>
<a href="mailto:Matplotlib-users@python.org" target="_blank">Matplotlib-users@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-users" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-users</a><br>
</blockquote></div>