Re: [Tutor] Matplotlib error with Python

2017-05-17 Thread Pooja Bhalode
Hi Alan,

Yes, that was the issue, I had a tempfile.py created my me some time back.
That was interfering with this one.
Thanks a lot for your input.

Hope you have a great day!
Pooja

On Wed, May 17, 2017 at 11:27 AM, Alan Gauld via Tutor 
wrote:

> On 17/05/17 15:07, Pooja Bhalode wrote:
>
> > */Users/poojabhalode/.bash_profile: line 1: .bashrc: No such file or
> > directory*
>
> I'd start with this one.
> Where is the bash script error coming from?
> Is there really no .bashrc?
> If not what is the impact of not having it?
>
> I'm also not clear what is calling bashrc...
>
> > *[[ 2 -1  0]*
> > * [-1  2 -1]*
>
> I have no idea what these numbers are.
>
> > *Traceback (most recent call last):*
> > *  File "/Users/poojabhalode/Google Drive/PYTHON/files/1sttest/
> May17.py",
> > line 7, in *
> > *import matplotlib*
> > *  File
> > "/System/Library/Frameworks/Python.framework/Versions/2.7/
> Extras/lib/python/matplotlib/__init__.py",
> > line 947, in *
> > *rcParams = rc_params()*
> > *  File
> > "/System/Library/Frameworks/Python.framework/Versions/2.7/
> Extras/lib/python/matplotlib/__init__.py",
> > line 856, in rc_params*
> > *fname = matplotlib_fname()*
> > *  File
> > "/System/Library/Frameworks/Python.framework/Versions/2.7/
> Extras/lib/python/matplotlib/__init__.py",
> > line 726, in matplotlib_fname*
> > *configdir = _get_configdir()*
> > *  File
> > "/System/Library/Frameworks/Python.framework/Versions/2.7/
> Extras/lib/python/matplotlib/__init__.py",
> > line 597, in _get_configdir*
> > *return _get_config_or_cache_dir(_get_xdg_config_dir())*
> > *  File
> > "/System/Library/Frameworks/Python.framework/Versions/2.7/
> Extras/lib/python/matplotlib/__init__.py",
> > line 566, in _get_config_or_cache_dir*
> > *if not _is_writable_dir(p):*
> > *  File
> > "/System/Library/Frameworks/Python.framework/Versions/2.7/
> Extras/lib/python/matplotlib/__init__.py",
> > line 228, in _is_writable_dir*
> > *t = tempfile.TemporaryFile(dir=p)*
> > *AttributeError: 'module' object has no attribute 'TemporaryFile'*
>
> You don't happen to have a file called tempfile.py in your
> folder by any chance? It could be that the code is picking
> it up instead of the standard library version?
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Matplotlib error with Python

2017-05-17 Thread Alan Gauld via Tutor
On 17/05/17 15:07, Pooja Bhalode wrote:

> */Users/poojabhalode/.bash_profile: line 1: .bashrc: No such file or
> directory*

I'd start with this one.
Where is the bash script error coming from?
Is there really no .bashrc?
If not what is the impact of not having it?

I'm also not clear what is calling bashrc...

> *[[ 2 -1  0]*
> * [-1  2 -1]*

I have no idea what these numbers are.

> *Traceback (most recent call last):*
> *  File "/Users/poojabhalode/Google Drive/PYTHON/files/1sttest/May17.py",
> line 7, in *
> *import matplotlib*
> *  File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
> line 947, in *
> *rcParams = rc_params()*
> *  File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
> line 856, in rc_params*
> *fname = matplotlib_fname()*
> *  File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
> line 726, in matplotlib_fname*
> *configdir = _get_configdir()*
> *  File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
> line 597, in _get_configdir*
> *return _get_config_or_cache_dir(_get_xdg_config_dir())*
> *  File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
> line 566, in _get_config_or_cache_dir*
> *if not _is_writable_dir(p):*
> *  File
> "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
> line 228, in _is_writable_dir*
> *t = tempfile.TemporaryFile(dir=p)*
> *AttributeError: 'module' object has no attribute 'TemporaryFile'*

You don't happen to have a file called tempfile.py in your
folder by any chance? It could be that the code is picking
it up instead of the standard library version?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Matplotlib error with Python

2017-05-17 Thread Pooja Bhalode
*Hi, *

*I have been working on a graphic user interface with matplotlib and
suddenly(Earlier, I didnt get these errors, and when I opened the files
now, I am) getting these errors: *
*/Users/poojabhalode/.bash_profile: line 1: .bashrc: No such file or
directory*
*[[ 2 -1  0]*
* [-1  2 -1]*
* [ 0 -1  2]]*
*[[  3.41421356e+00   8.32667268e-17  -6.37995760e-17]*
* [  0.e+00   2.e+00   1.35170527e-16]*
* [  0.e+00   0.e+00   5.85786438e-01]]*
*8.32667268469e-17*
*8.32667268469e-17*
*-6.37995760397e-17*
*0.0*
*1.35170526715e-16*
*0.0*
*0.0*
*[[ 3.41421356  0.  0.]*
* [ 0.  2.  0.]*
* [ 0.  0.  0.58578644]]*
*Traceback (most recent call last):*
*  File "/Users/poojabhalode/Google Drive/PYTHON/files/1sttest/May17.py",
line 7, in *
*import matplotlib*
*  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 947, in *
*rcParams = rc_params()*
*  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 856, in rc_params*
*fname = matplotlib_fname()*
*  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 726, in matplotlib_fname*
*configdir = _get_configdir()*
*  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 597, in _get_configdir*
*return _get_config_or_cache_dir(_get_xdg_config_dir())*
*  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 566, in _get_config_or_cache_dir*
*if not _is_writable_dir(p):*
*  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py",
line 228, in _is_writable_dir*
*t = tempfile.TemporaryFile(dir=p)*
*AttributeError: 'module' object has no attribute 'TemporaryFile'*
*[Finished in 0.2s with exit code 1]*
*[shell_cmd: python -u "/Users/poojabhalode/Google
Drive/PYTHON/files/1sttest/May17.py"]*
*[dir: /Users/poojabhalode/Google Drive/PYTHON/files/1sttest]*
*[path: /usr/bin:/bin:/usr/sbin:/sbin]*


*My code gives errors at the import statement itself: *

*Code::*
*import matplotlib*
*ERROR indicated here. *
*matplotlib.use("TkAgg")*
*from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,
NavigationToolbar2TkAgg*
*from matplotlib.figure import Figure*

*Can someone please let me know what is going wrong with this?*
*Thank you. I would really appreciate it.*

*Thanks!*
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor