Quantcast

matplotlib on Ubuntu 10.04 (64-bit)

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

matplotlib on Ubuntu 10.04 (64-bit)

Virgil Stokes
I have tried to produce a very simple plot with my recent installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit) using the following code (taken from the matplotlib tutorial material).

import matplotlib
import numpy
import matplotlib.pyplot as plt

print matplotlib.__version__
print numpy.__version__

plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()


If I execute this in Windows 7 (64-bit) it works correctly. If I execute this in Windows Vista (32-bit) it works correctly.
If I execute this in Ubuntu 10.04 64-bit the versions are printed out correctly and thus I believe that the packages are being imported; but, no plot is produced!

Why not?



------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Jeff Whitaker
On 9/13/10 1:38 PM, Virgil Stokes wrote:
I have tried to produce a very simple plot with my recent installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit) using the following code (taken from the matplotlib tutorial material).

import matplotlib
import numpy
import matplotlib.pyplot as plt

print matplotlib.__version__
print numpy.__version__

plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()


If I execute this in Windows 7 (64-bit) it works correctly. If I execute this in Windows Vista (32-bit) it works correctly.
If I execute this in Ubuntu 10.04 64-bit the versions are printed out correctly and thus I believe that the packages are being imported; but, no plot is produced!

Why not?

Virgil:

Probably your default backend on Ubuntu is a non-gui backend (like Agg).

See http://matplotlib.sourceforge.net/faq/installing_faq.html#backends for the definition of a "backend" and how to change the default.

-Jeff
-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : [hidden email]
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Benjamin Root-2
In reply to this post by Virgil Stokes
On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokes <[hidden email]> wrote:
I have tried to produce a very simple plot with my recent installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit) using the following code (taken from the matplotlib tutorial material).

import matplotlib
import numpy
import matplotlib.pyplot as plt

print matplotlib.__version__
print numpy.__version__

plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()


If I execute this in Windows 7 (64-bit) it works correctly. If I execute this in Windows Vista (32-bit) it works correctly.
If I execute this in Ubuntu 10.04 64-bit the versions are printed out correctly and thus I believe that the packages are being imported; but, no plot is produced!

Why not?


Virgil,

Did you build matplotlib from source?  If so, then chances are that one or more backends were not built properly.  This typically happens if you do not have all the build dependencies.

Note, the build will not necessarily fail if some dependencies are missing because the core portions of matplotlib still build successfully.

Ben Root


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Virgil Stokes
On 2010-09-13 21:55, Benjamin Root wrote:
On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokes <[hidden email]> wrote:
I have tried to produce a very simple plot with my recent installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit) using the following code (taken from the matplotlib tutorial material).

import matplotlib
import numpy
import matplotlib.pyplot as plt

print matplotlib.__version__
print numpy.__version__

plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()


If I execute this in Windows 7 (64-bit) it works correctly. If I execute this in Windows Vista (32-bit) it works correctly.
If I execute this in Ubuntu 10.04 64-bit the versions are printed out correctly and thus I believe that the packages are being imported; but, no plot is produced!

Why not?


Virgil,

Did you build matplotlib from source?
I did try this and believe that it succeeded (saw no errors displayed during the build).
If so, then chances are that one or more backends were not built properly.
But, I do not understand what you mean here...
This typically happens if you do not have all the build dependencies.
And what can I do to correct this?

Note, the build will not necessarily fail if some dependencies are missing because the core portions of matplotlib still build successfully.
Sorry Ben, bu I do not understand what you mean here.
Would you please explain how I can use some combination of the following (with Python 2.6 on Ubuntu 10.04 both 64-bit) to get a working matplotlib and numpy.

* python-numpy_1.4.1-4_amd64.deb
* python-numpy_1.5.0-1ppa1_amd64.deb
* numpy-1.5.0.tar.gz

and,

* matplotlib_0.99.3-1ubuntu1.debian.tar.gz
* matplotlib_0.99.3.orig.tar.gz
* matplotlib-1.0.0.tar.gz

This has become such a frustrating task that I would settle for vers. 0.99.3 of matplotlib and/or vers. 1.4.1-4 of numpy. I thought I understood Python and Ubuntu 10.04 enough to accomplish this task; but, obviously this was not the case. And I have looked at the FAQs and help given at matplotlib's homepage.

--V

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Eric Firing
On 09/13/2010 12:08 PM, Virgil Stokes wrote:

>   On 2010-09-13 21:55, Benjamin Root wrote:
>> On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokes <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>     I have tried to produce a very simple plot with my recent
>>     installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit)
>>     using the following code (taken from the matplotlib tutorial
>>     material).
>>
>>     *import matplotlib
>>     import numpy
>>     import matplotlib.pyplot as plt
>>
>>     print matplotlib.__version__
>>     print numpy.__version__
>>
>>     plt.plot([1,2,3,4])
>>     plt.ylabel('some numbers')
>>     plt.show()*
>>
>>     If I execute this in Windows 7 (64-bit) it works correctly. If I
>>     execute this in Windows Vista (32-bit) it works correctly.
>>     If I execute this in Ubuntu 10.04 64-bit the versions are printed
>>     out correctly and thus I believe that the packages are being
>>     imported; but, /no plot is produced!/
>>
>>     Why not?
>>
>>
>> Virgil,
>>
>> Did you build matplotlib from source?
> I did try this and believe that it succeeded (saw no errors displayed
> during the build).
>> If so, then chances are that one or more backends were not built
>> properly.
> But, I do not understand what you mean here...
>> This typically happens if you do not have all the build dependencies.
> And what can I do to correct this?
>>
>> Note, the build will not necessarily fail if some dependencies are
>> missing because the core portions of matplotlib still build successfully.
> Sorry Ben, bu I do not understand what you mean here.
> Would you please explain how I can use some combination of the following
> (with Python 2.6 on Ubuntu 10.04 both 64-bit) to get a working
> matplotlib and numpy.
>
> * *python-numpy_1.4.1-4_amd64.deb*
> * *python-numpy_1.5.0-1ppa1_amd64.deb*
> * *numpy-1.5.0.tar.gz*
>
> and,
>
> * *matplotlib_0.99.3-1ubuntu1.debian.tar.gz*
> * *matplotlib_0.99.3.orig.tar.gz*
> * *matplotlib-1.0.0.tar.gz*
>
> This has become such a frustrating task that I would settle for vers.
> 0.99.3 of matplotlib and/or vers. 1.4.1-4 of numpy. I thought I
> understood Python and Ubuntu 10.04 enough to accomplish this task; but,
> obviously this was not the case. And I have looked at the FAQs and help
> given at matplotlib's homepage.
If you would like up-to-date versions of both numpy and matplotlib, then
you can either find and install the *dev packages individually, or do
something like this:

sudo apt-get build-dep python-matplotlib
sudo apt-get remove python

Now untar your numpy, go in, build and install:

setup.py build
sudo setup.py install

And last, do the same for matplotlib, preferably with a checkout from
svn.  Some bugs have been fixed since the last release.

Before all of this, you might do well to uninstall whatever versions or
parts of numpy and matplotlib had been installed via your previous efforts.

The point of the first apt-get is to install things like freetype and
the gui toolkits.  The only problem is that this also installs an old
version of numpy, hence the second apt-get command.

The good news is that once you get over the hump of having the
dependencies installed, subsequent updates and compilations of numpy and
matplotlib are easy.  It is usually advisable to delete the build
directory, since setup.py is not very smart with respect to knowing what
needs to be recompiled.  Sometimes it is also necessary to clean out the
old version from its installation location.  See attached script for an
example of mpl uninstallation.

Eric

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

del_mpl (507 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Benjamin Root-2
On Mon, Sep 13, 2010 at 5:55 PM, Eric Firing <[hidden email]> wrote:
On 09/13/2010 12:08 PM, Virgil Stokes wrote:
 On 2010-09-13 21:55, Benjamin Root wrote:
On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokes <[hidden email]
<mailto:[hidden email]>> wrote:

   I have tried to produce a very simple plot with my recent
   installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit)
   using the following code (taken from the matplotlib tutorial
   material).

   *import matplotlib
   import numpy
   import matplotlib.pyplot as plt

   print matplotlib.__version__
   print numpy.__version__

   plt.plot([1,2,3,4])
   plt.ylabel('some numbers')
   plt.show()*

   If I execute this in Windows 7 (64-bit) it works correctly. If I
   execute this in Windows Vista (32-bit) it works correctly.
   If I execute this in Ubuntu 10.04 64-bit the versions are printed
   out correctly and thus I believe that the packages are being
   imported; but, /no plot is produced!/

   Why not?


Virgil,

Did you build matplotlib from source?
I did try this and believe that it succeeded (saw no errors displayed
during the build).
If so, then chances are that one or more backends were not built
properly.
But, I do not understand what you mean here...
This typically happens if you do not have all the build dependencies.
And what can I do to correct this?

Note, the build will not necessarily fail if some dependencies are
missing because the core portions of matplotlib still build successfully.
Sorry Ben, bu I do not understand what you mean here.
Would you please explain how I can use some combination of the following
(with Python 2.6 on Ubuntu 10.04 both 64-bit) to get a working
matplotlib and numpy.

* *python-numpy_1.4.1-4_amd64.deb*
* *python-numpy_1.5.0-1ppa1_amd64.deb*
* *numpy-1.5.0.tar.gz*

and,

* *matplotlib_0.99.3-1ubuntu1.debian.tar.gz*
* *matplotlib_0.99.3.orig.tar.gz*
* *matplotlib-1.0.0.tar.gz*

This has become such a frustrating task that I would settle for vers.
0.99.3 of matplotlib and/or vers. 1.4.1-4 of numpy. I thought I
understood Python and Ubuntu 10.04 enough to accomplish this task; but,
obviously this was not the case. And I have looked at the FAQs and help
given at matplotlib's homepage.

If you would like up-to-date versions of both numpy and matplotlib, then you can either find and install the *dev packages individually, or do something like this:

sudo apt-get build-dep python-matplotlib
sudo apt-get remove python

Now untar your numpy, go in, build and install:

setup.py build
sudo setup.py install

And last, do the same for matplotlib, preferably with a checkout from svn.  Some bugs have been fixed since the last release.

Before all of this, you might do well to uninstall whatever versions or parts of numpy and matplotlib had been installed via your previous efforts.

The point of the first apt-get is to install things like freetype and the gui toolkits.  The only problem is that this also installs an old version of numpy, hence the second apt-get command.

The good news is that once you get over the hump of having the dependencies installed, subsequent updates and compilations of numpy and matplotlib are easy.  It is usually advisable to delete the build directory, since setup.py is not very smart with respect to knowing what needs to be recompiled.  Sometimes it is also necessary to clean out the old version from its installation location.  See attached script for an example of mpl uninstallation.

Eric


Eric,

I keep on forgetting about that useful build-dep command.  Maybe it might be a good idea to include some of this information in the documentation as a tip of some sort?  I should also  see if yum for RedHat-based systems also have something similar.  Finding all the dependencies can be a little tedious at times and I often over-do it.

Ben Root


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Eric Firing
In reply to this post by Eric Firing
On 09/13/2010 12:55 PM, Eric Firing wrote:
> If you would like up-to-date versions of both numpy and matplotlib, then
> you can either find and install the *dev packages individually, or do
> something like this:
>
> sudo apt-get build-dep python-matplotlib
> sudo apt-get remove python

No! I meant:

sudo apt-get remove python-numpy

Eric


>
> Now untar your numpy, go in, build and install:


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Virgil Stokes
In reply to this post by Eric Firing
  On 14-Sep-2010 00:55, Eric Firing wrote:

> On 09/13/2010 12:08 PM, Virgil Stokes wrote:
>>   On 2010-09-13 21:55, Benjamin Root wrote:
>>> On Mon, Sep 13, 2010 at 2:38 PM, Virgil Stokes <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>     I have tried to produce a very simple plot with my recent
>>>     installation of matplotlib (1.0.0 64-bit) and numpy (1.5.0 64-bit)
>>>     using the following code (taken from the matplotlib tutorial
>>>     material).
>>>
>>>     *import matplotlib
>>>     import numpy
>>>     import matplotlib.pyplot as plt
>>>
>>>     print matplotlib.__version__
>>>     print numpy.__version__
>>>
>>>     plt.plot([1,2,3,4])
>>>     plt.ylabel('some numbers')
>>>     plt.show()*
>>>
>>>     If I execute this in Windows 7 (64-bit) it works correctly. If I
>>>     execute this in Windows Vista (32-bit) it works correctly.
>>>     If I execute this in Ubuntu 10.04 64-bit the versions are printed
>>>     out correctly and thus I believe that the packages are being
>>>     imported; but, /no plot is produced!/
>>>
>>>     Why not?
>>>
>>>
>>> Virgil,
>>>
>>> Did you build matplotlib from source?
>> I did try this and believe that it succeeded (saw no errors displayed
>> during the build).
>>> If so, then chances are that one or more backends were not built
>>> properly.
>> But, I do not understand what you mean here...
>>> This typically happens if you do not have all the build dependencies.
>> And what can I do to correct this?
>>>
>>> Note, the build will not necessarily fail if some dependencies are
>>> missing because the core portions of matplotlib still build successfully.
>> Sorry Ben, bu I do not understand what you mean here.
>> Would you please explain how I can use some combination of the following
>> (with Python 2.6 on Ubuntu 10.04 both 64-bit) to get a working
>> matplotlib and numpy.
>>
>> * *python-numpy_1.4.1-4_amd64.deb*
>> * *python-numpy_1.5.0-1ppa1_amd64.deb*
>> * *numpy-1.5.0.tar.gz*
>>
>> and,
>>
>> * *matplotlib_0.99.3-1ubuntu1.debian.tar.gz*
>> * *matplotlib_0.99.3.orig.tar.gz*
>> * *matplotlib-1.0.0.tar.gz*
>>
>> This has become such a frustrating task that I would settle for vers.
>> 0.99.3 of matplotlib and/or vers. 1.4.1-4 of numpy. I thought I
>> understood Python and Ubuntu 10.04 enough to accomplish this task; but,
>> obviously this was not the case. And I have looked at the FAQs and help
>> given at matplotlib's homepage.
>
> If you would like up-to-date versions of both numpy and matplotlib, then you
> can either find and install the *dev packages individually, or do something
> like this:
>
> sudo apt-get build-dep python-matplotlib
> sudo apt-get remove python
Very interesting --- what do these two commands actually do? (Just a short
explanation would be appreciated)
>
> Now untar your numpy, go in, build and install:
>
> setup.py build
> sudo setup.py install
Yes, this makes good sense...
>
> And last, do the same for matplotlib, preferably with a checkout from svn.  
> Some bugs have been fixed since the last release.
Never, have installed from svn; but, I assume that there is a tar file there
that I can download and use for a 64-bit Linux system.
>
> Before all of this, you might do well to uninstall whatever versions or parts
> of numpy and matplotlib had been installed via your previous efforts.
Yes, I have already done this; but, I will check this carefully again before I
start the reinstallation process.
>
> The point of the first apt-get is to install things like freetype and the gui
> toolkits.  The only problem is that this also installs an old version of
> numpy, hence the second apt-get command.
Ok, this seems to have answered my previous question.
>
> The good news is that once you get over the hump of having the dependencies
> installed, subsequent updates and compilations of numpy and matplotlib are
> easy.  It is usually advisable to delete the build directory, since setup.py
> is not very smart with respect to knowing what needs to be recompiled.  
> Sometimes it is also necessary to clean out the old version from its
> installation location.  See attached script for an example of mpl uninstallation.
This is exactly where I was headed --- a complete and new mpl installation with
the latest matplotlib.

Thanks for all the tips and pointing me in the correct direction. I will get
back to you on how it went.

--V

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: matplotlib on Ubuntu 10.04 (64-bit)

Virgil Stokes
In reply to this post by Eric Firing
On 14-Sep-2010 09:25, Eric Firing wrote:
On 09/13/2010 12:55 PM, Eric Firing wrote:
If you would like up-to-date versions of both numpy and matplotlib, then
you can either find and install the *dev packages individually, or do
something like this:

sudo apt-get build-dep python-matplotlib
sudo apt-get remove python
No! I meant:

sudo apt-get remove python-numpy

Eric


Now untar your numpy, go in, build and install:

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Ok Eric and Ben,
You made  my day --- I now have the latest numpy and matplotlib up and running on my Ubuntu 10.04 64-bit system. Some preliminary testing indicates things are working as they should. I am now summarizing what you had posted earlier on this problem Eric, so that others might benefit from your expertise  (as I have):

#  Thanks to Eric Firing ([hidden email]) who is a member of the matplotlib
#   user group for this clever use of Linux commands to accomplish the task
#   that solved my problem :-)
#
#  Lets "clean the slate" before a reinstallation (if you believe older versions are present)
sudo rm -rf /usr/local/lib/python2.6/dist-packages/matplotlib*
sudo rm -rf /usr/local/lib/python2.6/dist-packages/pylab*
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/mplot3d
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/axes_grid1
sudo rm -rf /usr/local/lib/python2.6/dist-packages/mpl_toolkits/axisartist
sudo rm  /usr/local/lib/python2.6/dist-packages/mpl_toolkits/*.py


# Install all the dependencies (installs an old version of numpy)
sudo apt-get build-dep python-matplotlib
# Now to get rid of the old version of numpy
sudo apt-get remove python-numpy

# Download the latest numpy tar, untar it, then navigate to
#  where setup.py for numpy is located and give the following commands
python setup.py build
python setup.py install

# Repeat the previous for matplotlib (download tar, untar it, etc.)
python setup.py build
python setup.py install


and th-th-tha-that-that's all folks!

--V

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Loading...