Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103253

Re: [newbie] Problem with matplotlib

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Newsgroups comp.lang.python
Subject Re: [newbie] Problem with matplotlib
Date 2016-02-20 08:42 +0000
Message-ID <mailman.16.1455957803.13884.python-list@python.org> (permalink)
References <1751492a-45ae-422d-8819-17de767a94c4@googlegroups.com>

Show all headers | View raw


On 20/02/2016 07:42, jenswaelkens@gmail.com wrote:
> When I use either of the following commands I get an error for which I don't have a solution, could someone here help me further?
> These are the commands:
> import matplotlib.pyplot as plt

Are you certain that this is what you typed?

C:\Users\Mark\Desktop>py -2.7
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import matplotlib.pyplot as plt
 >>>

Please have another go.

>
> or
>
> from matplotlib.pyplot import pyplot as plt

The above is incorrect, you are trying to import 'pyplot' from 
'matplotlib.pyplot'.

>
> This is the error I get:
> Traceback (most recent call last):
>    File "/home/waelkens/matplotlibdemo.py", line 2, in <module>
>      from matplotlib.pyplot import pyplot as plt
>    File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 27, in <module>
>      import matplotlib.colorbar
>    File "/usr/lib/python2.7/dist-packages/matplotlib/colorbar.py", line 36, in <module>
>      import matplotlib.contour as contour
>    File "/usr/lib/python2.7/dist-packages/matplotlib/contour.py", line 17, in <module>
>      import matplotlib.ticker as ticker
>    File "/usr/lib/python2.7/dist-packages/matplotlib/ticker.py", line 152, in <module>
>      import decimal
>    File "/usr/lib/python2.7/decimal.py", line 3744, in <module>
>      _numbers.Number.register(Decimal)
> AttributeError: 'module' object has no attribute 'Number'
>
> thanks in advance
> Jens
>

With this type of problem I'm inclined to throw the last line of the 
traceback, here the 'AttributeError' one, into a search engine and see 
what you come up with.  The hits you get are often enough to help you 
diagnose the problem.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[newbie] Problem with matplotlib jenswaelkens@gmail.com - 2016-02-19 23:42 -0800
  Re: [newbie] Problem with matplotlib Dave Farrance <df@see.replyto.invalid> - 2016-02-20 08:30 +0000
    Re: [newbie] Problem with matplotlib Dave Farrance <df@see.replyto.invalid> - 2016-02-20 08:49 +0000
      Re: [newbie] Problem with matplotlib Dave Farrance <df@see.replyto.invalid> - 2016-02-20 09:19 +0000
      Re: [newbie] Problem with matplotlib jenswaelkens@gmail.com - 2016-02-20 09:02 -0800
  Re: [newbie] Problem with matplotlib Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-02-20 08:42 +0000
    Re: [newbie] Problem with matplotlib jenswaelkens@gmail.com - 2016-02-20 09:05 -0800

csiph-web