Problem with importing numpy in Ubuntu

I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
and import it
import numpy
I get the following error
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

Which version of Python are you actually using in this example?
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
and import it
import numpy
I get the following error
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
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

I am using 2.5.6
Python 2.6.5 (r265:79063, Jun 28 2010, 20:31:28) [GCC 4.4.3] on linux2
On Tue, Jul 27, 2010 at 9:51 AM, Matthieu Brucher < matthieu.brucher@gmail.com> wrote:
Which version of Python are you actually using in this example?
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as
well
as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
and import it
import numpy
I get the following error
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
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Python 2.6.5 from Ubuntu? I tried the same yesterday evening, and it worked like a charm.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I am using 2.5.6
Python 2.6.5 (r265:79063, Jun 28 2010, 20:31:28) [GCC 4.4.3] on linux2
On Tue, Jul 27, 2010 at 9:51 AM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
Which version of Python are you actually using in this example?
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
and import it
import numpy
I get the following error
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
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Yes,
It seems there is a problem with some sort of header. I have no Idea. Look at this
http://article.gmane.org/gmane.comp.python.numeric.general/3508/match=numpy+...
On Tue, Jul 27, 2010 at 10:03 AM, Matthieu Brucher < matthieu.brucher@gmail.com> wrote:
Python 2.6.5 from Ubuntu? I tried the same yesterday evening, and it worked like a charm.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I am using 2.5.6
Python 2.6.5 (r265:79063, Jun 28 2010, 20:31:28) [GCC 4.4.3] on linux2
On Tue, Jul 27, 2010 at 9:51 AM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
Which version of Python are you actually using in this example?
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
> sys.path.append('/usr/lib/
python2.6/dist-packages')
and import it
> import numpy
I get the following error
> 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
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi robert.faryabi@gmail.comwrote:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories. Don't use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck

I can see the numpy now, but I have the problem with a shared library. Here is the error
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
Do you have any idea? It seems that the UCS4 and UCS2 are related to 16 and 8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris < charlesr.harris@gmail.com> wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi robert.faryabi@gmail.comwrote:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories. Don't use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared library. Here is the error
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
Do you have any idea? It seems that the UCS4 and UCS2 are related to 16 and 8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi robert.faryabi@gmail.com wrote:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
sys.path.append('/usr/lib/
python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories. Don't use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111, i.e
65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared library. Here is the error
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
Do you have any idea? It seems that the UCS4 and UCS2 are related to 16 and 8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi robert.faryabi@gmail.com wrote:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
> sys.path.append('/usr/lib/
python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories. Don't use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

I'm getting the same
sys.maxunicode
65535
I might have some "hand complied" python. Once I compiled Biopython long ago.
The problem is I do not know how to clean up all the python version that I have. I tried the reinstall option. It does not work. I cannot remove the python. It will wipe out my operating system.
Any suggestion?
On Tue, Jul 27, 2010 at 10:42 AM, Sebastian Haase seb.haase@gmail.comwrote:
The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111, i.e
65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared library. Here is the error
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
Do you have any idea? It seems that the UCS4 and UCS2 are related to 16
and
8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi <
robert.faryabi@gmail.com>
wrote:
I am new to numpy. Hopefully this is a correct forum to post my
question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
> import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
>> sys.path.append('/usr/lib/
python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat
~/.local/lib/python2.6/site-packages/install.pth
/usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories.
Don't
use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

What does "which python" return?
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I'm getting the same
sys.maxunicode
65535
I might have some "hand complied" python. Once I compiled Biopython long ago.
The problem is I do not know how to clean up all the python version that I have. I tried the reinstall option. It does not work. I cannot remove the python. It will wipe out my operating system.
Any suggestion?
On Tue, Jul 27, 2010 at 10:42 AM, Sebastian Haase seb.haase@gmail.com wrote:
The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111, i.e
65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared library. Here is the error
> 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
Do you have any idea? It seems that the UCS4 and UCS2 are related to 16 and 8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi robert.faryabi@gmail.com wrote:
I am new to numpy. Hopefully this is a correct forum to post my question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
>> import numpy Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
>>> sys.path.append('/usr/lib/ python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories. Don't use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

it returns
/usr/local/bin/python
On Tue, Jul 27, 2010 at 12:07 PM, Matthieu Brucher < matthieu.brucher@gmail.com> wrote:
What does "which python" return?
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I'm getting the same
sys.maxunicode
65535
I might have some "hand complied" python. Once I compiled Biopython long ago.
The problem is I do not know how to clean up all the python version that
I
have. I tried the reinstall option. It does not work. I cannot remove the python. It will wipe out my operating system.
Any suggestion?
On Tue, Jul 27, 2010 at 10:42 AM, Sebastian Haase seb.haase@gmail.com wrote:
The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111, i.e
65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared
library.
Here is the error
>> 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
Do you have any idea? It seems that the UCS4 and UCS2 are related to
16
and 8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi robert.faryabi@gmail.com wrote: > > I am new to numpy. Hopefully this is a correct forum to post my > question. > > I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0
as
> well as python-numpy using Ubuntu repository. > When I import the numpy into python, I get the following error. > > >> import numpy > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named numpy > > The package cannot be located. > > Then I tried to point the interpreter to the numpy > > >>> sys.path.append('/usr/lib/ > python2.6/dist-packages') >
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories. Don't use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

I just looked at my system more carefully.
There are two executable files
/usr/local/bin/python
and
/usr/bin/python this is a link to python2.6
I believe that the first one is source compiled version. So, how can I get rid of it?
On Tue, Jul 27, 2010 at 12:09 PM, Robert Faryabi robert.faryabi@gmail.comwrote:
it returns
/usr/local/bin/python
On Tue, Jul 27, 2010 at 12:07 PM, Matthieu Brucher < matthieu.brucher@gmail.com> wrote:
What does "which python" return?
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I'm getting the same
sys.maxunicode
65535
I might have some "hand complied" python. Once I compiled Biopython long ago.
The problem is I do not know how to clean up all the python version that
I
have. I tried the reinstall option. It does not work. I cannot remove
the
python. It will wipe out my operating system.
Any suggestion?
On Tue, Jul 27, 2010 at 10:42 AM, Sebastian Haase seb.haase@gmail.com wrote:
The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111, i.e
65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared
library.
Here is the error
>>> 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
Do you have any idea? It seems that the UCS4 and UCS2 are related to
16
and 8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote: > > > On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi > robert.faryabi@gmail.com > wrote: >> >> I am new to numpy. Hopefully this is a correct forum to post my >> question. >> >> I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0
as
>> well as python-numpy using Ubuntu repository. >> When I import the numpy into python, I get the following error. >> >> >> import numpy >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> ImportError: No module named numpy >> >> The package cannot be located. >> >> Then I tried to point the interpreter to the numpy >> >> >>> sys.path.append('/usr/lib/ >> python2.6/dist-packages') >> > > I use an install.pth file > > $charris@ubuntu ~$ cat > ~/.local/lib/python2.6/site-packages/install.pth > /usr/local/lib/python2.6/dist-packages > > You will need to create the .local directory and its
subdirectories.
> Don't > use Python 3.0, use 3.1 or greater if you want to experiment. > > <snip> > > Chuck > > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Tue, Jul 27, 2010 at 9:29 AM, Robert Faryabi robert.faryabi@gmail.com wrote:
I just looked at my system more carefully.
There are two executable files
/usr/local/bin/python
and
/usr/bin/python this is a link to python2.6
I believe that the first one is source compiled version. So, how can I get rid of it?
I'd start by renaming it:
$ sudo mv python pythonSTOP
And then deleteing it if everything looks good.

You should be allowed to remove anything in /usr/local without fear to kill your operation system. In case you miss python2.5 afterwards, you should be able to just install it with apt-get install python2.5 at any time - it would go to /usr/lib + /usr/bin + ... NOT /usr/local.
It is unlikely that you ever installed python by hand into anything else than /usr/local -- so there should be not lasting conflict.
Before deleting anything you could also check your environment variables: PYTHONPATH should not exist. PYTHONHOME neither PATH should not contain /usr/local
Then, "which python" should not point to /usr/local anymore and you should be all fine (still having "garbage" in /usr.local)
-S.
On Tue, Jul 27, 2010 at 6:29 PM, Robert Faryabi robert.faryabi@gmail.com wrote:
I just looked at my system more carefully.
There are two executable files
/usr/local/bin/python
and
/usr/bin/python this is a link to python2.6
I believe that the first one is source compiled version. So, how can I get rid of it?
On Tue, Jul 27, 2010 at 12:09 PM, Robert Faryabi robert.faryabi@gmail.com wrote:
it returns
/usr/local/bin/python
On Tue, Jul 27, 2010 at 12:07 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
What does "which python" return?
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I'm getting the same
> sys.maxunicode
65535
I might have some "hand complied" python. Once I compiled Biopython long ago.
The problem is I do not know how to clean up all the python version that I have. I tried the reinstall option. It does not work. I cannot remove the python. It will wipe out my operating system.
Any suggestion?
On Tue, Jul 27, 2010 at 10:42 AM, Sebastian Haase seb.haase@gmail.com wrote:
The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111, i.e
65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com: > I can see the numpy now, but I have the problem with a shared > library. > Here is the error > >>>> 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 > > > Do you have any idea? It seems that the UCS4 and UCS2 are related > to 16 > and > 8 bit unicode. > > > On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris > charlesr.harris@gmail.com wrote: >> >> >> On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi >> robert.faryabi@gmail.com >> wrote: >>> >>> I am new to numpy. Hopefully this is a correct forum to post my >>> question. >>> >>> I have Ubuntu Luci system. I installed Python 2.6.5 and Python >>> 3.0 as >>> well as python-numpy using Ubuntu repository. >>> When I import the numpy into python, I get the following error. >>> >>> >> import numpy >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in <module> >>> ImportError: No module named numpy >>> >>> The package cannot be located. >>> >>> Then I tried to point the interpreter to the numpy >>> >>> >>> sys.path.append('/usr/lib/ >>> python2.6/dist-packages') >>> >> >> I use an install.pth file >> >> $charris@ubuntu ~$ cat >> ~/.local/lib/python2.6/site-packages/install.pth >> /usr/local/lib/python2.6/dist-packages >> >> You will need to create the .local directory and its >> subdirectories. >> Don't >> use Python 3.0, use 3.1 or greater if you want to experiment. >> >> <snip> >> >> Chuck >> >> >> _______________________________________________ >> NumPy-Discussion mailing list >> NumPy-Discussion@scipy.org >> http://mail.scipy.org/mailman/listinfo/numpy-discussion >> > > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > >
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Thanks, I did almost the same yesterday and now everything works fine.
On Wed, Jul 28, 2010 at 4:29 AM, Sebastian Haase seb.haase@gmail.comwrote:
You should be allowed to remove anything in /usr/local without fear to kill your operation system. In case you miss python2.5 afterwards, you should be able to just install it with apt-get install python2.5 at any time - it would go to /usr/lib + /usr/bin + ... NOT /usr/local.
It is unlikely that you ever installed python by hand into anything else than /usr/local -- so there should be not lasting conflict.
Before deleting anything you could also check your environment variables: PYTHONPATH should not exist. PYTHONHOME neither PATH should not contain /usr/local
Then, "which python" should not point to /usr/local anymore and you should be all fine (still having "garbage" in /usr.local)
-S.
On Tue, Jul 27, 2010 at 6:29 PM, Robert Faryabi robert.faryabi@gmail.com wrote:
I just looked at my system more carefully.
There are two executable files
/usr/local/bin/python
and
/usr/bin/python this is a link to python2.6
I believe that the first one is source compiled version. So, how can I
get
rid of it?
On Tue, Jul 27, 2010 at 12:09 PM, Robert Faryabi <
robert.faryabi@gmail.com>
wrote:
it returns
/usr/local/bin/python
On Tue, Jul 27, 2010 at 12:07 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote:
What does "which python" return?
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I'm getting the same
>> sys.maxunicode
65535
I might have some "hand complied" python. Once I compiled Biopython long ago.
The problem is I do not know how to clean up all the python version that I have. I tried the reinstall option. It does not work. I cannot remove the python. It will wipe out my operating system.
Any suggestion?
On Tue, Jul 27, 2010 at 10:42 AM, Sebastian Haase <
seb.haase@gmail.com>
wrote:
The origin of this problem is the fact that Python supports (at
least)
2 types of Unicode: 2 bytes and/or 4 bytes per character.
Additionally, for some incomprehensible reason the Python source
code
(as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
( check >>> sys.maxunicode to see what you have; I get 1114111,
i.e
>65535 , so I have 4 byte (on Debian) )
So, most likely you have some "hand compiled" Python somewhere ....
- Sebastian Haase
On Tue, Jul 27, 2010 at 4:33 PM, Matthieu Brucher matthieu.brucher@gmail.com wrote: > It's a problem of compilation of Python and numpy with different > parameters. But I've tried the same yesterday, and the Ubuntu > repository are OK in that respect, so there is something not quite > right with your configuration. > > Matthieu > > 2010/7/27 Robert Faryabi robert.faryabi@gmail.com: >> I can see the numpy now, but I have the problem with a shared >> library. >> Here is the error >> >>>>> 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 >> >> >> Do you have any idea? It seems that the UCS4 and UCS2 are related >> to 16 >> and >> 8 bit unicode. >> >> >> On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris >> charlesr.harris@gmail.com wrote: >>> >>> >>> On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi >>> robert.faryabi@gmail.com >>> wrote: >>>> >>>> I am new to numpy. Hopefully this is a correct forum to post my >>>> question. >>>> >>>> I have Ubuntu Luci system. I installed Python 2.6.5 and Python >>>> 3.0 as >>>> well as python-numpy using Ubuntu repository. >>>> When I import the numpy into python, I get the following error. >>>> >>>> >> import numpy >>>> Traceback (most recent call last): >>>> File "<stdin>", line 1, in <module> >>>> ImportError: No module named numpy >>>> >>>> The package cannot be located. >>>> >>>> Then I tried to point the interpreter to the numpy >>>> >>>> >>> sys.path.append('/usr/lib/ >>>> python2.6/dist-packages') >>>> >>> >>> I use an install.pth file >>> >>> $charris@ubuntu ~$ cat >>> ~/.local/lib/python2.6/site-packages/install.pth >>> /usr/local/lib/python2.6/dist-packages >>> >>> You will need to create the .local directory and its >>> subdirectories. >>> Don't >>> use Python 3.0, use 3.1 or greater if you want to experiment. >>> >>> <snip> >>> >>> Chuck >>> >>> >>> _______________________________________________ >>> NumPy-Discussion mailing list >>> NumPy-Discussion@scipy.org >>> http://mail.scipy.org/mailman/listinfo/numpy-discussion >>> >> >> >> _______________________________________________ >> NumPy-Discussion mailing list >> NumPy-Discussion@scipy.org >> http://mail.scipy.org/mailman/listinfo/numpy-discussion >> >> > > > > -- > Information System Engineer, Ph.D. > Blog: http://matt.eifelle.com > LinkedIn: http://www.linkedin.com/in/matthieubrucher > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Tue, Jul 27, 2010 at 7:42 AM, Sebastian Haase seb.haase@gmail.com wrote:
The origin of this problem is the fact that Python supports (at least) 2 types of Unicode: 2 bytes and/or 4 bytes per character.
It only supports those two, and that's purely an internal implementation detail. Python can encode unicode in many encodings, but *internally* it has to have some representation of its own, and it can use ucs2 or ucs4. Which one to use is a compile-time flag:
--enable-unicode[=ucs[24]]
Additionally, for some incomprehensible reason the Python source code (as downloaded from python.org) defaults to 2ByteUnicode whereas all (major) Linux distributions default to 4ByteUnicode.....
The reason is that many systems (Java, Windows, Qt natively - http://en.wikipedia.org/wiki/Utf-16#Use_in_major_operating_systems_and_envir...) use utf-16 as their native encoding, and ucs2 is a subset of utf-16, so in many environments that makes interoperability easier. But ucs2 can not encode all of unicode, while ucs4 can, so Linux distributions choose to use ucs4 as their internal encoding to ensure that all unicode code points can be encoded in python.
This email from Guido explains his position on leaving the ucs2/4 choice up to packagers:
http://mail.python.org/pipermail/python-dev/2008-July/080892.html
The official Python 2.x unicode story is well explained here: http://docs.python.org/howto/unicode.html
and here is the corresponding document for 3.x: http://docs.python.org/release/3.1.2/howto/unicode.html
Joel Spolsky has a very nice introduction to the main ideas behind unicode: http://www.joelonsoftware.com/articles/Unicode.html
and Matthew Brett has a nice and more concise set of notes on the matter:
https://cirl.berkeley.edu/mb312/pydagogue/introducing_unicode.html https://cirl.berkeley.edu/mb312/pydagogue/python_unicode.html
I should note that anyone who is thinking of porting any non-trivial amount of code from python 2.x to 3.x will save a lot of time and frustration by spending just a couple of hours reading and understanding the above. It's not that much work, and if you don't understand how Python thinks of strings, you're very likely to make a painful mess in such a code transition effort. I know that the few hours I put into reading the above have already paid off tremendously for us with the zeromq/ipython codebase.
Cheers,
f

On Wed, Jul 28, 2010 at 12:36 PM, Fernando Perez fperez.net@gmail.com wrote:
The official Python 2.x unicode story is well explained here: http://docs.python.org/howto/unicode.html
and here is the corresponding document for 3.x: http://docs.python.org/release/3.1.2/howto/unicode.html
Just in case you're still thirsty for more info on Unicode... :)
Min Ragan-Kelley just did a great summary writeup of these questions from a low-level perspective: for pyzmq we need to handle strings (i.e. unicode) at the python level, but efficiently and unambiguously communicate with a networking layer written in C. We spent a lot of time thinking about this, and his writeup is a great resource for anyone who needs to look at this from a C/low-level angle:
http://ptsg.berkeley.edu/~minrk/zmq/unicode.html
This adds a view that isn't made very explicit in any of the docs I'd previously sent.
Cheers,
f

As Sebastian suggested, I might have some hand compiled python.
Anyone could tell me how can I get rid of all my python and reinstall a fresh one?
On Tue, Jul 27, 2010 at 10:33 AM, Matthieu Brucher < matthieu.brucher@gmail.com> wrote:
It's a problem of compilation of Python and numpy with different parameters. But I've tried the same yesterday, and the Ubuntu repository are OK in that respect, so there is something not quite right with your configuration.
Matthieu
2010/7/27 Robert Faryabi robert.faryabi@gmail.com:
I can see the numpy now, but I have the problem with a shared library. Here is the error
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
Do you have any idea? It seems that the UCS4 and UCS2 are related to 16
and
8 bit unicode.
On Tue, Jul 27, 2010 at 10:16 AM, Charles R Harris charlesr.harris@gmail.com wrote:
On Tue, Jul 27, 2010 at 7:46 AM, Robert Faryabi <
robert.faryabi@gmail.com>
wrote:
I am new to numpy. Hopefully this is a correct forum to post my
question.
I have Ubuntu Luci system. I installed Python 2.6.5 and Python 3.0 as well as python-numpy using Ubuntu repository. When I import the numpy into python, I get the following error.
import numpy
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named numpy
The package cannot be located.
Then I tried to point the interpreter to the numpy
> sys.path.append('/usr/lib/
python2.6/dist-packages')
I use an install.pth file
$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth /usr/local/lib/python2.6/dist-packages
You will need to create the .local directory and its subdirectories.
Don't
use Python 3.0, use 3.1 or greater if you want to experiment.
<snip>
Chuck
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (6)
-
Charles R Harris
-
Fernando Perez
-
Keith Goodman
-
Matthieu Brucher
-
Robert Faryabi
-
Sebastian Haase