Re: ImportError: No module named Ngl

From: Jean-Francois Malouin <jfmalouin_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 08 2011 - 21:06:08 MST

Here it goes:

~$ which python

/usr/bin/python

~$ ls -la /usr/lib/python2.6/site-packages/PyNGL

drwxr-sr-x 3 root staff 4096 2011-02-05 14:57 ./
drwxrwsr-x 3 root staff 4096 2011-02-05 14:57 ../
-rwxr-xr-x 1 root staff 289418 2011-02-05 14:57 fplib.so*
-rw-r--r-- 1 root staff 8667 2011-02-05 14:57 hlu.py
-rw-r--r-- 1 root staff 8074 2011-02-05 14:57 hlu.pyc
-rwxr-xr-x 1 root staff 10251474 2011-02-05 14:57 _hlu.so*
-rw-r--r-- 1 root staff 14 2011-02-05 14:57 __init__.py
-rw-r--r-- 1 root staff 157 2011-02-05 14:57 __init__.pyc
drwxr-sr-x 8 root staff 4096 2011-02-05 14:57 ncarg/
-rw-r--r-- 1 root staff 249124 2011-02-05 14:57 Ngl.py
-rw-r--r-- 1 root staff 187257 2011-02-05 14:57 Ngl.pyc
-rw-r--r-- 1 root staff 97 2011-02-05 14:57 pyngl_version.py
-rw-r--r-- 1 root staff 305 2011-02-05 14:57 pyngl_version.pyc

~$ cat /usr/lib/python2.6/dist-packages/Ngl.pth
PyNGL

~$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
'', '/home/malin/PlanetaryClimateCourseware/CoursewareModules',
'/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old',
'/usr/lib/python2.6/lib-dynload',
'/usr/local/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages/PyNGL',
'/usr/lib/python2.6/dist-packages/PIL',
'/usr/lib/python2.6/dist-packages/gst-0.10',
'/usr/lib/pymodules/python2.6',
'/usr/lib/python2.6/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.6/gtk-2.0']

And this was my very first try at installing PyNgl.

Thanks!
jf

On Tue, Feb 8, 2011 at 12:25 PM, Mary Haley <haley@ucar.edu> wrote:
> Hi Jean-Francois,
>
> I'm hoping that the issue is not related to the fact that you downloaded a
> PyNGL
> that was compiled with gcc 4.3.2, and you are running gcc 4.4.5. I've never
> tried this combo, so I don't know if it will work. I don't have a PyNGL
> compiled
> with gcc 4.4.5, unfortunately.
>
> First, though, let's make sure your current environment is set up correctly.
>
> Please let me know what the following reports on your system:
>
> which python
> ls /usr/local/lib/python2.6/site-packages
> ls /usr/local/lib/python2.6/site-packages/PyNGL
> cat /usr/local/lib/python2.6/site-packages/Ngl.pth
>
> and then run python interactively to see what the system path looks like:
>
> python
> import sys
> sys.path
> <ctrl-d>
>
> Finally, do you have any old PyNGL installations that might getting loaded
> instead of the newer one?
>
> --Mary
>
> On Feb 8, 2011, at 8:30 AM, Jean-Francois Malouin wrote:
>
>> Thanks,
>>
>> I tried your suggestion:  move the PyNgl stuff to
>> /usr/lib/python2.6/dist-packages and after editing Ngl.py for the path
>> I get:
>>
>> :~$ python
>> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
>> [GCC 4.4.5] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>
>>>>> import Ngl
>>
>> Segmentation fault
>>
>> hmmm,
>> jf
>>
>> On Tue, Feb 8, 2011 at 4:27 AM, Nikolay Koldunov <koldunovn@gmail.com>
>> wrote:
>>>
>>> Hi, Jean-Francois
>>>
>>> Since you using Ubuntu, your problem might be related to renaming of
>>> the site-packages to dist-packages in this distribution.
>>> Solution to this is described here:
>>> http://www.pyngl.ucar.edu/User_forum/Archives/2010/0119.html
>>>
>>> Hope it will help :)
>>>
>>> Kolya
>>>
>>>
>>> On Tue, Feb 8, 2011 at 4:45 AM, Jean-Francois Malouin
>>> <jfmalouin@gmail.com> wrote:
>>>>
>>>> Hello,
>>>>
>>>> First post here.
>>>>
>>>> I saw the same problem here:
>>>> http://www.pyngl.ucar.edu/User_forum/Archives/2009/0044.html
>>>>
>>>> but there was no solution provided afaik.
>>>>
>>>>> From Earth System Grid I downloaded the precompiled version of PyNGL
>>>>> and ncl:
>>>>
>>>> PyNGL-1.3.1.linux-debian-i686-gcc432-py265-numpy141.tar.gz
>>>> ncl_ncarg-5.2.1.Linux_Debian_i686_nodap_gcc412.tar.gz
>>>>
>>>> I installed PyNGL in /usr/local/lib/python2.6/site-packages/
>>>>
>>>> ls -la /usr/local/lib/python2.6/site-packages/
>>>>
>>>> -rw-r--r-- 1 root staff    6 2011-02-05 14:57 Ngl.pth
>>>> drwxr-sr-x 3 root staff 4096 2011-02-05 14:57 PyNGL/
>>>> -rw-r--r-- 1 root staff  540 2011-02-05 14:57 PyNGL-1.3.1-py2.6.egg-info
>>>>
>>>> and ncl_ncarg-5.2.1 in /usr/local/{bin,include,lib}
>>>>
>>>> I then set PYTHONPATH to
>>>>
>>>> export
>>>> PYTHONPATH="~/PlanetaryClimateCourseware/CoursewareModules:/usr/local/lib/python2.6/site-packages"
>>>>
>>>> but no go to load the PyNGL module:
>>>>
>>>> python
>>>> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
>>>> [GCC 4.4.5] on linux2
>>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>>>
>>>>>>> import Ngl
>>>>
>>>> Traceback (most recent call last):
>>>>  File "<stdin>", line 1, in <module>
>>>> ImportError: No module named Ngl
>>>>
>>>> I must do something really stupid.
>>>> Any help?
>>>>
>>>> My box:
>>>>
>>>> Linux bebe 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:48 UTC
>>>> 2011 i686 GNU/Linux
>>>>
>>>> malin@bebe:~$ lsb_release -a
>>>> No LSB modules are available.
>>>> Distributor ID: Ubuntu
>>>> Description:    Ubuntu 10.10
>>>> Release:        10.10
>>>> Codename:       maverick
>>>>
>>>> ii  python                  2.6.6-2ubuntu2
>>>> ii  python-dev              2.6.6-2ubuntu2
>>>> ii  python-cairo            1.8.8-1
>>>> ii  python-gobject-cairo    2.21.5-0ubuntu3
>>>> ii  idle-python2.6          2.6.6-5ubuntu1
>>>> ii  python-numpy            1:1.3.0-3build1
>>>> ii  gcc                     4:4.4.4-1ubuntu2
>>>> ii  gfortran                4:4.4.4-1ubuntu2
>>>> Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
>>>>
>>>> thanks for the help!
>>>> jf
>>>> --
>>>> "...things standing shall fall,
>>>> but the moving shall ever stay."
>>>> _______________________________________________
>>>> pyngl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>>>
>>>
>>>
>>>
>>> --
>>> Nikolay Koldunov
>>> University of Hamburg
>>> Institute of Oceanography
>>> KlimaCampus
>>>
>>> koldunovn@gmail.com
>>> nikolay.koldunov@zmaw.de
>>> ph. +49 40 42838 7580
>>> Grindelberg 5, room 210,
>>> 20144 Hamburg, Germany
>>>
>>
>>
>>
>> --
>> "...things standing shall fall,
>> but the moving shall ever stay."
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
>

-- 
"...things standing shall fall,
but the moving shall ever stay."
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Feb 8 21:06:14 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 11 2011 - 16:11:13 MST