
Dear friends, I installed numpy in a 32-bit machines running with RHEL3. The installation was successful. I tested the installtion by importint numpy inside python interpreter. By once i shutdown the system and restart, and try the same, it says ImportError: No module named numpy. What could be the problem i dnt get. Kindly someone write me on the same. Thanks, Bala

Bala, One thing I can think of is that you might have multiple versions of Python installed. For example, I have Python 2.4 and 2.5 on my machine, but numpy is only installed for 2.5. Since just running "python" brings up 2.4, sometimes I find myself in the wrong interpreter typing "import numpy", which fails in the way you described. Cheers, Alan On Sat, May 31, 2008 at 10:52 AM, Bala subramanian <bala.biophysics@gmail.com> wrote:
Dear friends,
I installed numpy in a 32-bit machines running with RHEL3. The installation was successful. I tested the installtion by importint numpy inside python interpreter. By once i shutdown the system and restart, and try the same, it says ImportError: No module named numpy.
What could be the problem i dnt get. Kindly someone write me on the same.
Thanks, Bala
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Dear Alan, I am using python 2.4.3 that came pre-installed with my linux. I dnt have any other version. But i noticed another problem. In fact no other modules are getting imported now. I have pasted the error below. Suggest me what i should do now. $ python 'import site' failed; use -v for traceback Python 2.4.3 (#1, Aug 8 2006, 18:51:20) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-20)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named numpy import string Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named string
On Sat, May 31, 2008 at 8:45 PM, Alan McIntyre <alan.mcintyre@gmail.com> wrote:
Bala,
One thing I can think of is that you might have multiple versions of Python installed. For example, I have Python 2.4 and 2.5 on my machine, but numpy is only installed for 2.5. Since just running "python" brings up 2.4, sometimes I find myself in the wrong interpreter typing "import numpy", which fails in the way you described.
Cheers, Alan
On Sat, May 31, 2008 at 10:52 AM, Bala subramanian <bala.biophysics@gmail.com> wrote:
Dear friends,
I installed numpy in a 32-bit machines running with RHEL3. The installation was successful. I tested the installtion by importint numpy inside python interpreter. By once i shutdown the system and restart, and try the same, it says ImportError: No module named numpy.
What could be the problem i dnt get. Kindly someone write me on the same.
Thanks, Bala
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

On Mon, 2008-06-02 at 10:49 +0530, Bala subramanian wrote:
Dear Alan, I am using python 2.4.3 that came pre-installed with my linux. I dnt have any other version. But i noticed another problem. In fact no other modules are getting imported now. I have pasted the error below. Suggest me what i should do now.
That's strange, you definitely have something wrong with your python. Could you try this: python -c "import sys; print sys.path" And also tell us what your environment look like ? (just dump it using the env command if you are using bash). cheers, David

Dear David, I gave the following and pressed TAB, it seems that i have two python installation in my linux. $ python python python2 python2.2 python2.4 pythonsh When i give python, python 2.4.3 interpreter opens When i give python2, python 2.2.3 interpreter opens The default is python 2.4.3. Now when i use 2.4.3, i get the import error but when i use 2.2.3 i dnt have the import problem. When i give *ls -d /usr/lib/py** ( i get only the lib for pythong2.2) */usr/lib/python2.2* I dnt understand why python 2.4 dosent contain seperate libraries installed in /usr/lib? The following is the result of the command - python -c "import sys; print sys.path" ['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages'] ----------------------------------------------------------------------------------------------------------------------------------- OUTPUT OF env command MANPATH=/usr/local/ifc/man:/usr/local/ifc/man:/usr/local/ifc/man:/usr/kerberos/man:/usr/share/man/en:/usr/share/man:/usr/X11R6/man:/usr/local/man SSH_AGENT_PID=1970 HOSTNAME=bala_lin PVM_RSH=/usr/bin/rsh INTEL_LICENSE_FILE=/usr/local/ifc/licenses:/opt/intel/licenses:/home/souvik/intel/licenses:/usr/local/ifc/licenses:/opt/intel/licenses:/home/souvik/intel/licenses DESKTOP_STARTUP_ID= TERM=xterm SHELL=/bin/bash HISTSIZE=1000 GTK_RC_FILES=/etc/gtk/gtkrc:/home/souvik/.gtkrc-1.2-gnome2 WINDOWID=25165899 QTDIR=/usr/lib/qt-3.1 USER=souvik LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35: LD_LIBRARY_PATH=/usr/local/ifc/lib:/usr/local/ifc/lib SSH_AUTH_SOCK=/tmp/ssh-zHIO1917/agent.1917 PVM_ROOT=/usr/share/pvm3 SESSION_MANAGER=local/bala_lin:/tmp/.ICE-unix/1917 PATH=/usr/local/autodock/share/bin:/usr/local/autodock/i86Linux2/bin:/usr/local/ifc/bin:/usr/local/autodock/share/bin:/usr/local/autodock/i86Linux2/bin:/usr/local/ifc/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/amber9/exe:/usr/local/ifc/bin/:/usr/local/gromacs/bin:/usr/local/fftw/bin:/usr/local/vmd-1.8.6/lib:/usr/local/vmd-1.8.6/bin:/usr/local/pass:/usr/local/nab-5.0/bin:/usr/local/RealPlayer/plugins:/usr/local/mmtsb_toolset/perl:/usr/local/mmtsb_toolset/bin:/home/souvik/X3DNA/BASEPARS:/home/souvik/X3DNA/bin:/usr/local/modeller-9v2/bin:/home/souvik/bin:/usr/local/amber9/exe:/usr/local/ifc/bin/:/usr/local/gromacs/bin:/usr/local/fftw/bin:/usr/local/vmd-1.8.6/lib:/usr/local/vmd-1.8.6/bin:/usr/local/pass:/usr/local/nab-5.0/bin:/usr/local/RealPlayer/plugins:/usr/local/mmtsb_toolset/perl:/usr/local/mmtsb_toolset/bin:/home/souvik/X3DNA/BASEPARS:/home/souvik/X3DNA/bin:/usr/local/modeller-9v2/bin MAIL=/var/spool/mail/souvik PWD=/home/souvik INPUTRC=/etc/inputrc XMODIFIERS=@im=none LANG=en_US.UTF-8 LAMHELPFILE=/etc/lam/lam-helpfile PYTHONHOME=/usr/local/lib_LINUX-rh9/ GDMSESSION=Default SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass SHLVL=2 HOME=/home/souvik GNOME_DESKTOP_SESSION_ID=Default LOGNAME=souvik LESSOPEN=|/usr/bin/lesspipe.sh %s DISPLAY=:0.0 GRACE_HOME=/usr/local/grace G_BROKEN_FILENAMES=1 COLORTERM=gnome-terminal XAUTHORITY=/home/souvik/.Xauthority _=/usr/bin/env

Bala subramanian wrote:
I dnt understand why python 2.4 dosent contain seperate libraries installed in /usr/lib?
Because your python 2.4 was installed in /usr/local, I guess:
The following is the result of the command - python -c "import sys; print sys.path"
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages']
It is still not clear to me why you cannot import string in python 2.4: python automatically add $PREFIX/lib/python-$VERSION/site-packages to the path list it is looking at for import. Did you install python 2.4 from sources ? Or is it installed by your package manager (rpm, since it looks like you are using Red Hat). cheers, David

Hi, Where is numpy installation located ? (you should find it with locate numpy) Matthieu 2008/6/2 Bala subramanian <bala.biophysics@gmail.com>:
Dear David,
I gave the following and pressed TAB, it seems that i have two python installation in my linux.
$ python
python python2 python2.2 python2.4 pythonsh
When i give python, python 2.4.3 interpreter opens When i give python2, python 2.2.3 interpreter opens
The default is python 2.4.3.
Now when i use 2.4.3, i get the import error but when i use 2.2.3 i dnt have the import problem. When i give *ls -d /usr/lib/py** ( i get only the lib for pythong2.2)
*/usr/lib/python2.2*
I dnt understand why python 2.4 dosent contain seperate libraries installed in /usr/lib?
The following is the result of the command - python -c "import sys; print sys.path"
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages']
-----------------------------------------------------------------------------------------------------------------------------------
OUTPUT OF env command
MANPATH=/usr/local/ifc/man:/usr/local/ifc/man:/usr/local/ifc/man:/usr/kerberos/man:/usr/share/man/en:/usr/share/man:/usr/X11R6/man:/usr/local/man
SSH_AGENT_PID=1970
HOSTNAME=bala_lin
PVM_RSH=/usr/bin/rsh
INTEL_LICENSE_FILE=/usr/local/ifc/licenses:/opt/intel/licenses:/home/souvik/intel/licenses:/usr/local/ifc/licenses:/opt/intel/licenses:/home/souvik/intel/licenses
DESKTOP_STARTUP_ID=
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
GTK_RC_FILES=/etc/gtk/gtkrc:/home/souvik/.gtkrc-1.2-gnome2
WINDOWID=25165899
QTDIR=/usr/lib/qt-3.1
USER=souvik
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
LD_LIBRARY_PATH=/usr/local/ifc/lib:/usr/local/ifc/lib
SSH_AUTH_SOCK=/tmp/ssh-zHIO1917/agent.1917
PVM_ROOT=/usr/share/pvm3
SESSION_MANAGER=local/bala_lin:/tmp/.ICE-unix/1917
PATH=/usr/local/autodock/share/bin:/usr/local/autodock/i86Linux2/bin:/usr/local/ifc/bin:/usr/local/autodock/share/bin:/usr/local/autodock/i86Linux2/bin:/usr/local/ifc/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/amber9/exe:/usr/local/ifc/bin/:/usr/local/gromacs/bin:/usr/local/fftw/bin:/usr/local/vmd-1.8.6/lib:/usr/local/vmd-1.8.6/bin:/usr/local/pass:/usr/local/nab-5.0/bin:/usr/local/RealPlayer/plugins:/usr/local/mmtsb_toolset/perl:/usr/local/mmtsb_toolset/bin:/home/souvik/X3DNA/BASEPARS:/home/souvik/X3DNA/bin:/usr/local/modeller-9v2/bin:/home/souvik/bin:/usr/local/amber9/exe:/usr/local/ifc/bin/:/usr/local/gromacs/bin:/usr/local/fftw/bin:/usr/local/vmd-1.8.6/lib:/usr/local/vmd-1.8.6/bin:/usr/local/pass:/usr/local/nab-5.0/bin:/usr/local/RealPlayer/plugins:/usr/local/mmtsb_toolset/perl:/usr/local/mmtsb_toolset/bin:/home/souvik/X3DNA/BASEPARS:/home/souvik/X3DNA/bin:/usr/local/modeller-9v2/bin
MAIL=/var/spool/mail/souvik
PWD=/home/souvik
INPUTRC=/etc/inputrc
XMODIFIERS=@im=none
LANG=en_US.UTF-8
LAMHELPFILE=/etc/lam/lam-helpfile
PYTHONHOME=/usr/local/lib_LINUX-rh9/
GDMSESSION=Default
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=2
HOME=/home/souvik
GNOME_DESKTOP_SESSION_ID=Default
LOGNAME=souvik
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
GRACE_HOME=/usr/local/grace
G_BROKEN_FILENAMES=1
COLORTERM=gnome-terminal
XAUTHORITY=/home/souvik/.Xauthority
_=/usr/bin/env
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
-- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher
participants (5)
-
Alan McIntyre
-
Bala subramanian
-
David Cournapeau
-
David Cournapeau
-
Matthieu Brucher