numpy under Ubuntu 9.10 (64bit)

155 views
Skip to first unread message

Valery Khamenya

unread,
Feb 6, 2010, 1:33:08 PM2/6/10
to Unladen Swallow
Hi all,

as I know numpy work OK with u-s. However I get problems with it.

1. I've got numpy installed in CPython 2.6.4 enviroment. It comes as
ubuntu package.
when I try to import this instance of numpy module from u-s there
comes the error:

**************************************
Python 2.6.4 (r261:1071, Feb 6 2010, 18:55:30)
[GCC 4.4.1] on linux2
[Unladen Swallow 2009Q4]
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/numpy/__init__.py", line 130,
in <module>
import add_newdocs
File "/usr/lib/python2.6/dist-packages/numpy/add_newdocs.py", line
9, in <module>
from lib import add_newdoc
File "/usr/lib/python2.6/dist-packages/numpy/lib/__init__.py", line
4, in <module>
from type_check import *
File "/usr/lib/python2.6/dist-packages/numpy/lib/type_check.py",
line 8, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python2.6/dist-packages/numpy/core/__init__.py", line
5, in <module>
import multiarray
ImportError: /usr/lib/python2.6/dist-packages/numpy/core/multiarray.so:
undefined symbol: _PyUnicodeUCS4_IsWhitespace
**************************************


2. I tried to import numpy right from
unladen-trunk/unladen-bmarks/lib/numpy, it led to the error:

**************************************
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/valery/wrk/unladen-trunk/unladen-bmarks/lib/numpy/numpy/__init__.py",
line 121, in <module>
raise ImportError(msg)
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python intepreter from there.
**************************************

I have used u-s compiled from today trunk. Similar errors were a month
or two ago though.

Q1: could the numpy installation from Ubuntu 9.10 be somehow used?
(it would be a prefered way for me)

if Ubuntu's numpy can't be reused,

Q2: what is a supposed way to get numpy working under u-s?
(I remember to have problems installing numpy from sources for u-s
some time ago...)

Thanks in advance for the hints!

Best regards
--
Valery A.Khamenya

Collin Winter

unread,
Feb 8, 2010, 12:11:10 AM2/8/10
to Valery Khamenya, Unladen Swallow

So you're trying to use a version of numpy that was compiled against
CPython 2.6.4? I wouldn't do that. There's a chance Unladen Swallow
has broken ABI compatibility with CPython 2.6.4, which could lead to
subtle errors, given what you're doing. We have maintained source
compatibility, but binary compatibility is harder.

In this case, the problem is easy: Ubuntu configured their Python
binary with UCS4 Unicode, while the Python/Unladen default is USC2
(which is probably what you're using). This can be set by passing a
flag to ./configure.

> 2. I tried to import numpy right from
> unladen-trunk/unladen-bmarks/lib/numpy, it led to the error:
>
> **************************************
>>>> import numpy
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/home/valery/wrk/unladen-trunk/unladen-bmarks/lib/numpy/numpy/__init__.py",
> line 121, in <module>
>    raise ImportError(msg)
> ImportError: Error importing numpy: you should not try to import numpy from
>        its source directory; please exit the numpy source tree, and relaunch
>        your python intepreter from there.
> **************************************
>
> I have used u-s compiled from today trunk. Similar errors were a month
> or two ago though.

Numpy really wants to be installed before you use it. You should read
the Numpy README and installation instructions.

Collin Winter

Valery Khamenya

unread,
Feb 22, 2010, 9:59:55 AM2/22/10
to Unladen Swallow, Collin Winter
Hi all,

On Mon, Feb 8, 2010 at 6:11 AM, Collin Winter <collin...@google.com> wrote:
...

Numpy really wants to be installed before you use it. You should read
the Numpy README and installation instructions.

Collin Winter

I've listed the issues regarding building the numpy with u-s here:


Hints are welcome.

Best regards
--
Valery

Jeffrey Yasskin

unread,
Feb 23, 2010, 12:10:59 PM2/23/10
to Valery Khamenya, Unladen Swallow, Collin Winter

Have you succeeded in building numpy against Python 2.6.4? (not just
installing it from Ubuntu) If not, that's the first thing to get
working. If you can build numpy against Python 2.6, and it works, but
you can't build it against Unladen Swallow, then you should send us
the details of what changed, and we'll try to help.

Valery Khamenya

unread,
Feb 23, 2010, 2:23:16 PM2/23/10
to Jeffrey Yasskin, Unladen Swallow, Collin Winter
Hi Jeffrey,

On Tue, Feb 23, 2010 at 6:10 PM, Jeffrey Yasskin <jyas...@google.com> wrote:
> Have you succeeded in building numpy against Python 2.6.4? (not just
> installing it from Ubuntu) If not, that's the first thing to get
> working. If you can build numpy against Python 2.6, and it works, but
> you can't build it against Unladen Swallow, then you should send us
> the details of what changed, and we'll try to help.

Well, today I've find an unfair way to go through.

There are 2 a bit overlapping pages:

http://code.google.com/p/unladen-swallow/wiki/Benchmarks
http://code.google.com/p/unladen-swallow/wiki/Testing

In fact, both deal with http://unladen-swallow.googlecode.com/svn/tests

And the "Testing" page appears to have a line that is not mentioned in
"Benchmarks" page:

$ make install

and this one presents me with a numpy installation :)

So, I can use u-s even more often now.

--
Valery A.Khamenya

Collin Winter

unread,
Feb 23, 2010, 2:25:53 PM2/23/10
to Valery Khamenya, Jeffrey Yasskin, Unladen Swallow

That is because there are no benchmarks that use NumPy, which means
there are no benchmarks that require installation, which means there
was no reason to mention "make install".

Collin Winter

Valery Khamenya

unread,
Feb 23, 2010, 2:52:24 PM2/23/10
to Collin Winter, Jeffrey Yasskin, Unladen Swallow
> That is because there are no benchmarks that use NumPy, which means
> there are no benchmarks that require installation, which means there
> was no reason to mention "make install".

Oh, I didn't even think to blame docs or something.

Just I could have skipped CPython for months already, if I knew how to
get numpy working in u-s.

The only personal "challenge" that still lefts visible for me is low
level profiling with u-s. I tried and failed (like with numpy). If I
get it too, I will be quite happy :)

Regards
--
Valery

Reply all
Reply to author
Forward
0 new messages