installed python-scipy causing errors with numpy

A couple weeks ago I installed version 1.2 from sources, as described here:

http://matplotlib.sourceforge.net/users/installing.html

I’m running Ubuntu 10.04 LTS. Everything was working fine. Looks like numpy version 1.3 in place. A few minutes ago I installed python-scipy from the Ubuntu Synaptic package manager. Getting this any time I run a program:

python colorbar_testing.py
Traceback (most recent call last):
File “colorbar_testing.py”, line 5, in
from matplotlib import pyplot, mpl
File “/usr/local/lib/python2.6/dist-packages/matplotlib/init.py”, line 173, in
version__numpy,
numpy.version))
ImportError: numpy 1.4 or later is required; you have 1.3.0

Version control with python, matplotlib, numpy, etc problematic when compiled from source? Shall I reinstall everything again, including python-scipy? What order? Thanks.

You need to remove your numpy and scipy packages and install both of these from source (just use the most recent releases), and then rebuild matplotlib. Numpy has to be installed before building either scipy or mpl, but mpl and scipy are independent of each other so either can be built once a suitable numpy is there.

Eric

···

On 02/18/2012 07:17 AM, Michael Rawlins wrote:

A couple weeks ago I installed version 1.2 from sources, as described here:

http://matplotlib.sourceforge.net/users/installing.html

I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like
numpy version 1.3 in place. A few minutes ago I installed python-scipy
from the Ubuntu Synaptic package manager. Getting this any time I run a
program:

>python colorbar_testing.py
Traceback (most recent call last):
File "colorbar_testing.py", line 5, in <module>
from matplotlib import pyplot, mpl
File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py",
line 173, in <module>
__version__numpy__, numpy.__version__))
ImportError: numpy 1.4 or later is required; you have 1.3.0

Version control with python, matplotlib, numpy, etc problematic when
compiled from source? Shall I reinstall everything again, including
python-scipy? What order? Thanks.

···

From: Eric Firing <efiring@…202…>
To: matplotlib-users@…564…net
Sent: Saturday, February 18, 2012 12:26 PM
Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy

On 02/18/2012 07:17 AM, Michael Rawlins wrote:

A couple weeks ago I installed version 1.2 from sources, as described here:

http://matplotlib.sourceforge.net/users/installing.html

I’m running Ubuntu 10.04 LTS. Everything was working fine. Looks like
numpy version 1.3 in place. A few minutes ago I installed python-scipy
from the Ubuntu Synaptic package manager. Getting this any time I run a
program:

python colorbar_testing.py
Traceback (most recent call last):
File “colorbar_testing.py”, line 5, in
from matplotlib import pyplot, mpl
File “/usr/local/lib/python2.6/dist-packages/matplotlib/init.py”,
line 173, in
version__numpy, numpy.version))
ImportError: numpy 1.4 or later is required; you have
1.3.0

Version control with python, matplotlib, numpy, etc problematic when
compiled from source? Shall I reinstall everything again, including
python-scipy? What order? Thanks.

You need to remove your numpy and scipy packages and install both of
these from source (just use the most recent releases), and then rebuild
matplotlib. Numpy has to be installed before building either scipy or
mpl, but mpl and scipy are independent of each other so either can be
built once a suitable numpy is there.

Eric

Thanks Eric. One things escapes me. Are scipy and python redundant? Should both be installed?

I’d installed numpy and matplotlib from source. Working right now on locating and remove all traces of those programs before re-installing. Can python 2.6 that I installed through Synapic Package manager stay in place. Perhaps I should remove it too just to be sure
everything works right?

Mike

------------------------------------------------------------------------
*From:* Eric Firing <efiring@...202...>
*To:* matplotlib-users@lists.sourceforge.net
*Sent:* Saturday, February 18, 2012 12:26 PM
*Subject:* Re: [Matplotlib-users] installed python-scipy causing errors
with numpy

>
> A couple weeks ago I installed version 1.2 from sources, as described
here:
>
> http://matplotlib.sourceforge.net/users/installing.html
>
> I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like
> numpy version 1.3 in place. A few minutes ago I installed python-scipy
> from the Ubuntu Synaptic package manager. Getting this any time I run a
> program:
>
> >python colorbar_testing.py <http://colorbar_testing.py>
> Traceback (most recent call last):
> File "colorbar_testing.py", line 5, in <module>
> from matplotlib import pyplot, mpl
> File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py",
> line 173, in <module>
> __version__numpy__, numpy.__version__))
> ImportError: numpy 1.4 or later is required; you have 1.3.0
>
> Version control with python, matplotlib, numpy, etc problematic when
> compiled from source? Shall I reinstall everything again, including
> python-scipy? What order? Thanks.

You need to remove your numpy and scipy packages and install both of
these from source (just use the most recent releases), and then rebuild
matplotlib. Numpy has to be installed before building either scipy or
mpl, but mpl and scipy are independent of each other so either can be
built once a suitable numpy is there.

Eric

Thanks Eric. One things escapes me. Are scipy and python redundant?
Should both be installed?

I'd installed numpy and matplotlib from source. Working right now on
locating and remove all traces of those programs before re-installing.
Can python 2.6 that I installed through Synapic Package manager stay in
place. Perhaps I should remove it too just to be sure everything works
right?

No! The python 2.6 package is perfectly fine. Try to remove that, and you are likely to hose your whole system. It sounds like your only problem was that you had the numpy package installed, and it was being found instead of the one installed from source.

Eric

···

On 02/18/2012 10:49 AM, Michael Rawlins wrote:

On 02/18/2012 07:17 AM, Michael Rawlins wrote:

Mike

···

From: Eric Firing <efiring@…202…>
To: Michael Rawlins <rawlins02@…2642…>
Cc:matplotlib-users@lists.sourceforge.netmatplotlib-users@lists.sourceforge.net
Sent: Saturday, February 18, 2012 3:57 PM
Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy

On 02/18/2012 10:49 AM, Michael Rawlins wrote:


From: Eric Firing <efiring@…202…>
To: matplotlib-users@lists.sourceforge.net
Sent: Saturday, February 18, 2012 12:26 PM
Subject: Re: [Matplotlib-users] installed python-scipy causing errors
with numpy

On 02/18/2012 07:17 AM, Michael Rawlins wrote:

A couple weeks ago I installed version 1.2 from sources, as described
here:

http://matplotlib.sourceforge.net/users/installing.html

I’m running Ubuntu 10.04 LTS. Everything was working
fine. Looks like
numpy version 1.3 in place. A few minutes ago I installed python-scipy
from the Ubuntu Synaptic package manager. Getting this any time I run a
program:

python colorbar_testing.py http://colorbar_testing.py
Traceback (most recent call last):
File “colorbar_testing.py”, line 5, in
from matplotlib import pyplot, mpl
File “/usr/local/lib/python2.6/dist-packages/matplotlib/init.py”,
line 173, in
version__numpy, numpy.version))
ImportError: numpy 1.4 or later is required; you have 1.3.0

Version control with python, matplotlib, numpy, etc problematic
when
compiled from source? Shall I reinstall everything again, including
python-scipy? What order? Thanks.

You need to remove your numpy and scipy packages and install both of
these from source (just use the most recent releases), and then rebuild
matplotlib. Numpy has to be installed before building either scipy or
mpl, but mpl and scipy are independent of each other so either can be
built once a suitable numpy is there.

Eric

Thanks Eric. One things escapes me. Are scipy and python redundant?
Should both be installed?

I’d installed numpy and matplotlib from source. Working right now on
locating and remove all traces of those programs before re-installing.
Can python 2.6 that I installed through Synapic Package manager stay in
place. Perhaps I should remove it too just to be
sure everything works
right?

No! The python 2.6 package is perfectly fine. Try to remove that, and
you are likely to hose your whole system. It sounds like your only
problem was that you had the numpy package installed, and it was being
found instead of the one installed from source.

Eric

I don’t understand what you mean when you say “…you had the numpy package installed,…” Are you saying a version of numpy came along with scipy, and that was the one “being found”? Also, to run programs which need scipy.stats I’ll have to again install scipy. When I did that using Synaptic it broke my system. In summary, I don’t understand what caused the problem. Shall I install scipy from source?

The version of numpy I installed last month from source is 1.61. I’ve just found a couple
files:

/usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst
/usr/lib/python2.6/dist-packages/numpy-1.3.0.egg-info.

I’ll assume those numbers 1.3.0 are not an issue.

Mike

------------------------------------------------------------------------
*From:* Eric Firing <efiring@...202...>
*To:* Michael Rawlins <rawlins02@...9...>
*Cc:* "matplotlib-users@lists.sourceforge.net"
<matplotlib-users@lists.sourceforge.net>
*Sent:* Saturday, February 18, 2012 3:57 PM
*Subject:* Re: [Matplotlib-users] installed python-scipy causing errors
with numpy

>
> ------------------------------------------------------------------------
> *From:* Eric Firing <efiring@...202... <mailto:efiring@…202…>>
> *To:* matplotlib-users@lists.sourceforge.net
<mailto:matplotlib-users@lists.sourceforge.net>
> *Sent:* Saturday, February 18, 2012 12:26 PM
> *Subject:* Re: [Matplotlib-users] installed python-scipy causing errors
> with numpy
>
> >
> > A couple weeks ago I installed version 1.2 from sources, as described
> here:
> >
> > http://matplotlib.sourceforge.net/users/installing.html
> >
> > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like
> > numpy version 1.3 in place. A few minutes ago I installed python-scipy
> > from the Ubuntu Synaptic package manager. Getting this any time I run a
> > program:
> >
> > >python colorbar_testing.py <http://colorbar_testing.py>
<http://colorbar_testing.py>
> > Traceback (most recent call last):
> > File "colorbar_testing.py", line 5, in <module>
> > from matplotlib import pyplot, mpl
> > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py",
> > line 173, in <module>
> > __version__numpy__, numpy.__version__))
> > ImportError: numpy 1.4 or later is required; you have 1.3.0
> >
> > Version control with python, matplotlib, numpy, etc problematic when
> > compiled from source? Shall I reinstall everything again, including
> > python-scipy? What order? Thanks.
>
> You need to remove your numpy and scipy packages and install both of
> these from source (just use the most recent releases), and then rebuild
> matplotlib. Numpy has to be installed before building either scipy or
> mpl, but mpl and scipy are independent of each other so either can be
> built once a suitable numpy is there.
>
> Eric
>
> Thanks Eric. One things escapes me. Are scipy and python redundant?
> Should both be installed?
>
> I'd installed numpy and matplotlib from source. Working right now on
> locating and remove all traces of those programs before re-installing.
> Can python 2.6 that I installed through Synapic Package manager stay in
> place. Perhaps I should remove it too just to be sure everything works
> right?

No! The python 2.6 package is perfectly fine. Try to remove that, and
you are likely to hose your whole system. It sounds like your only
problem was that you had the numpy package installed, and it was being
found instead of the one installed from source.

Eric

I don't understand what you mean when you say "...you had the numpy
package installed,.." Are you saying a version of numpy came along with
scipy, and that was the one "being found"? Also, to run programs which

No, scipy builds on numpy but does not include it.

need scipy.stats I'll have to again install scipy. When I did that using
Synaptic it broke my system. In summary, I don't understand what caused

Installing the scipy package will pull in numpy as its dependency, so if you need a newer version of numpy, as you do for mpl, then you also need to remove any packages that depend on it and install them from source.

the problem. Shall I install scipy from source?

Yes, after completely removing the numpy package and installing numpy from source.

The version of numpy I installed last month from source is 1.61. I've
just found a couple files:

/usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst

This looks wrong. Did you untar the tarball in /usr/bin? Don't. Untar it in some non-system location, maybe a subdirectory of your home directory, and then

cd numpy
python setup.py build
sudo python setup.py install

which should install in /usr/local/lib/python2.6/dist-packages. Same drill for scipy and matplotlib.

The idea is that synaptic packages get installed in the /usr tree, and anything you install from source gets installed in the /usr/local tree, so they don't get mixed up.

/usr/lib/python2.6/dist-packages/numpy-1.3.0.egg-info.

Not good. This is from the ubuntu package.

I'll assume those numbers 1.3.0 are not an issue.

I wouldn't assume that. Things seem rather scrambled up.

Eric

···

On 02/18/2012 11:54 AM, Michael Rawlins wrote:

On 02/18/2012 10:49 AM, Michael Rawlins wrote:
> On 02/18/2012 07:17 AM, Michael Rawlins wrote:

Mike

···

From: Eric Firing <efiring@…202…>
To: Michael Rawlins <rawlins02@…9…>
Cc: “matplotlib-users@…1838…urceforge.net” matplotlib-users@lists.sourceforge.net
Sent: Saturday, February 18, 2012 5:42 PM
Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy

On 02/18/2012 11:54 AM, Michael Rawlins wrote:

The version of numpy I installed last month from source is 1.61. I’ve
just found a couple files:

/usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst

This looks wrong. Did you untar the tarball in /usr/bin? Don’t. Untar
it in some non-system location, maybe a subdirectory of your home
directory, and then

cd numpy
python setup.py build
sudo python setup.py install

Thanks. Yes, I did untar numpy.tar in /usr/bin. Won’t do that again. When I installed matplotlib I untared that tarball in a subdirectory of my home directory.

Any suggestions for being sure I completely remove all potentially conflicting traces of numpy and matplotlib before reinstall? I usually use the locate command to find files with those names in them. As you know, the files are most often found in just a few
directories.

Mike

Mike,

I think that using synaptic to uninstall what you installed with synaptic, together with manually removing the misplaced untarred tree, should take care of everything.

locate is indeed very helpful, but don't forget that its database is updated at intervals, not continuously.

Eric

···

On 02/18/2012 01:14 PM, Michael Rawlins wrote:

------------------------------------------------------------------------
*From:* Eric Firing <efiring@...202...>
*To:* Michael Rawlins <rawlins02@...9...>
*Cc:* "matplotlib-users@lists.sourceforge.net"
<matplotlib-users@lists.sourceforge.net>
*Sent:* Saturday, February 18, 2012 5:42 PM
*Subject:* Re: [Matplotlib-users] installed python-scipy causing errors
with numpy

On 02/18/2012 11:54 AM, Michael Rawlins wrote:
>
> The version of numpy I installed last month from source is 1.61. I've
> just found a couple files:
>
> /usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst

This looks wrong. Did you untar the tarball in /usr/bin? Don't. Untar
it in some non-system location, maybe a subdirectory of your home
directory, and then

cd numpy
python setup.py build
sudo python setup.py install

Thanks. Yes, I did untar numpy.tar in /usr/bin. Won't do that again.
When I installed matplotlib I untared that tarball in a subdirectory of
my home directory.

Any suggestions for being sure I completely remove all potentially
conflicting traces of numpy and matplotlib before reinstall? I usually
use the locate command to find files with those names in them. As you
know, the files are most often found in just a few directories.

Mike