Re: Installation problem on Ubuntu 10.04

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 13 2010 - 15:04:04 MDT

Thanks Kolya.

Just FYI: we replaced this code awhile back, but haven't released the new version
yet. It won't construct the path, and instead uses get_python_lib().

--Mary

On Aug 13, 2010, at 5:54 AM, Nikolay Koldunov wrote:

> Hi Andrea,
>
> In Ubuntu all external packages installed not in "site-packages"
> directory, but in "dist-packages", for whatever reason.
> In order to make things work under Ubuntu you first should unpack
> binaries in to the right directory (/usr/lib/pythonX.Y/dist-packages)
> and then you also might need to modify Ngl.py a bit to make it look
> like this:
>
> pkgs_pth = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3],
> 'site-packages')
> # Try a different one.
> if not (os.path.exists(pkgs_pth)):
> pkgs_pth = os.path.join(sys.prefix, 'lib64', 'python'+sys.version[:3],
> 'site-packages')
>
> if not (os.path.exists(pkgs_pth)):
> pkgs_pth = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3],
> 'dist-packages')
>
> if not (os.path.exists(pkgs_pth)):
> pkgs_pth = os.path.join(sys.prefix, 'lib64', 'python'+sys.version[:3],
> 'dist-packages')
>
> Hope it will help,
> Kolya
>
>
> On Fri, Aug 13, 2010 at 1:43 PM, Andrea Cimatoribus <cimatori@knmi.nl> wrote:
>> Hi Mary,
>> first of all, thanks for the reply. Unfortunately, this doesn't seem to be
>> the problem.
>> I first changed the directory in pynglex file, and now it works, but just to
>> give:
>>
>> Error: I am unable to import the NumPy version of Ngl via
>> 'import Ngl'
>>
>> Indeed I did the untar in the /usr directory (and to be sure, I did it
>> again), and ls of the directories
>>
>> /usr/lib/python2.6/site-packages/PyN*
>>
>> does give quite a lot of output, among which I see Nio.py, Ngl.py,...
>>
>> Just to be sure, I checked that I do have numpy installed (it works with
>> 'import numpy', not 'import NumPy').
>>
>> Thanks for the support,
>> Andrea
>>
>> Mary Haley wrote:
>>
>> Hi Andrea,
>>
>> This could be a simple path problem. The pynglex problem is something
>> different.
>>
>> What does:
>>
>> which python
>>
>> report, and where did you untar the PyNGL tar file from?
>>
>> You need to untar it in the *root* directory of where python resides.
>>
>> For example, if "which python" reports "/usr//bin", then
>> the root directory is "/usr" (and NOT /usr/bin or /usr/lib).
>>
>> This means you should be in /usr when you untar the file.
>>
>> To fix pynglex, you can edit the file directory and change
>> /d2/haley/external/bin/python2.6 to /usr/bin/python.
>>
>> It sounds like your python installation is in /usr. Do you
>> see anything if you type:
>>
>> ls /usr/lib/python2.6/site-packages
>>
>> and
>>
>> ls /usr/lib/python2.6/site-packages/PyNGL
>>
>> ?
>>
>> --Mary
>>
>> On Aug 12, 2010, at 1:32 AM, Andrea Cimatoribus wrote:
>>
>>
>>
>> Dear users,
>> I'm not even a beginner of PyNGL/PyNIO, so please forgive me if the
>> question is silly.
>>
>> I am trying to install PyNGL/PyNIO on my machine running Ubuntu 10.04. I
>> am running python 2.6 and gcc 4.4 (which I think is not supposed to be
>> supported by the binaries you provide).
>>
>> I followed the installation instructions, but I can't get the modules
>> working. If I issue "import Ngl" into python, I get "ImportError: No
>> module named Ngl. If I try to run "pynglex ngl01p" I get:
>> zsh: /usr/bin/pynglex: bad interpreter:
>> /d2/haley/external/bin/python2.6: no file or directory
>>
>> This latter error makes me suspect that the problem is not with gcc, but
>> with some environmental variable that is not properly set (there is no
>> such directory as /d2/haley... on my machine).
>> The installation directory is /usr/lib/python2.6... as the guide
>> assumes, so I guess this shouldn't be a problem.
>> What am I missing? Do I need to set up some variable?
>>
>> Thanks for your help,
>> Andrea
>>
>> _______________________________________________
>> pyngl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>>
>>
>>
>>
>> _______________________________________________
>> 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 211,
> 20144 Hamburg, Germany

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Aug 13 15:04:07 2010

This archive was generated by hypermail 2.1.8 : Fri Aug 13 2010 - 15:07:13 MDT