[GRASS-dev] python grass problems on OSX (Incompatible library version for module)

massimo di stefano massimodisasha at yahoo.it
Mon May 11 02:02:17 EDT 2009


Hi Glynn, All,



Il giorno 11/mag/09, alle ore 03:32, Glynn Clements ha scritto:

> massimo di stefano wrote:
>
>> i'm tring to utilize a python function iside the grass environment,
>> but i gett errors about :
>>
>> "Incompatible library version for module"
>
> If "make clean" and rebuilding doesn't fix it, then it sounds like you
> have more than one version of GRASS on your system, and it's picking
> up the wrong libraries.
>

Yes it is, i tried make clean && make distclean,
i also tried on a fresh svn download.
I've installed on my system different grass versions :

grass64 (binary verion)
grass65 , grass70  (from svn)




>> outside a running GRASS, it works from python.  From python started
>> inside a GRASS shell, it doesn't work.
>
> That sounds like multiple versions.


How to avoid this problem?
has my system hardcoded some where the existence oh other grss  
version? can i masherate/eliminate something?


>
>
>> the function i'm using is prety simple :
>>
>>
>>
>> ###
>> import os
>> import subprocess
>>
>> def OssimImg2rr(img1):
>>     os.environ['DYLD_FRAMEWORK_PATH'] = '/var/tmp/XcodeBuilds/ 
>> Release'
>>     os.environ['OSSIM_PREFS_FILE'] = '/Users/sasha/ossim_preferences'
>>     output = subprocess.Popen(['/var/tmp/XcodeBuilds/Release/ 
>> img2rr' ,str(img1)],stdout=subprocess.PIPE).communicate()[0]
>
> Leave os.environ alone; create a new environment dictionary and pass
> that to subprocess.Popen(), e.g.:
>
> 	myenv = os.environ.copy()
> 	myenv['DYLD_FRAMEWORK_PATH'] = '/var/tmp/XcodeBuilds/Release'
> 	myenv['OSSIM_PREFS_FILE'] = '/Users/sasha/ossim_preferences'
> 	output = subprocess.Popen(..., env = myenv).communicate()[0]
>
> This isn't related to this specific problem, though, just general
> Python coding advice.


Thanks! i'm self.teached so advice like these ere for me a great help

i hope i modified it well :

def OssimImg2rr(img1):
     myenv = os.environ.copy()
     myenv['DYLD_FRAMEWORK_PATH'] = '/var/tmp/XcodeBuilds/Release'
     myenv['OSSIM_PREFS_FILE'] = '/Users/sasha/ossim_preferences'
     output = subprocess.Popen(['/var/tmp/XcodeBuilds/Release/ 
img2rr' ,str(img1)], stdout=subprocess.PIPE, env = myenv).communicate() 
[0]






Massimo Di Stefano
massimodisasha a yahoo.it

epifanio on   irc.freenode.net  /join gfoss





Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


More information about the grass-dev mailing list