[GRASS-dev] PYTHONPATH question

Michael Barton michael.barton at asu.edu
Tue Jul 29 18:07:23 EDT 2008


The important thing is that additional libraries like wxpython and  
matplotlib get installed for the default version, whatever that is. We  
want to make sure that a script is running the same python that you  
get when you type "python" from the command line. If you *want* to run  
it through a different python, you should just be able to use: [path  
to desired python] myscript.py.

So what is the best way to make sure that the 'default' python is used  
in a script?

Michael
______________________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Jul 29, 2008, at 2:59 PM, William Kyngesburye wrote:

> On Jul 29, 2008, at 3:30 PM, Glynn Clements wrote:
>
>> Michael Barton wrote:
>>
>>> See below...
>>
>> William has already identified the core problem: scripts are using a
>> different version of Python to the interactive interpreter, and
>> presumably only one of the two versions has matplotlib installed.
>>
>> If you set PYTHONPATH, all interpreters will find modules in those
>> directories (it will even override system modules, so don't put the
>> system directories in PYTHONPATH, only site-packages). If PYTHONPATH
>> is unset, each version will use its own site-packages directory.
>>
>> Given that the two versions are almost identical (2.5.1 vs 2.5.2), I
>> suggest setting PYTHONPATH to contain both modules' site-packages
>> directories, and nothing else.
>>
> Or make sure the correct python is running.
>
> They are similar versions, but compiled differently - one (2.5.1)  
> for OSX Leopard, the other (2.5.2) for Tiger and also-works-on- 
> Leopard.  The Mac Python list would have a better idea if this a  
> workable solution, or crazy.
>
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
>
> First Pogril: Why is life like sticking your head in a bucket filled  
> with hyena offal?
> Second Pogril: I don't know.  Why IS life like sticking your head in  
> a bucket filled with hyena offal?
> First Pogril: I don't know either.  Wretched, isn't it?
>
> -HitchHiker's Guide to the Galaxy
>
>



More information about the grass-dev mailing list