On 03/10/2014 09:28 AM, Claire Brenner wrote:
>
> Hello,
>
> I want to use the otbApplication within a python script and thus set
> the PYTHONPATH to C:\OSGeo4W\apps\orfeotoolbox\python
Right.
> and the ITK_AUTOLOAD_PATH to C:\OSGeo4W\apps\orfeotoolbox\wrapping.

Wrong : this is C:\OSGeo4W\apps\orfeotoolbox\applications


Also you need C:\OSGeo4W\bin to be first in your PATH.
Also, which python do you use ? You need to use OSGeo4W's Python.

You need to replicate the OSGeo4W shell environment before doing anything.
Look at what is done in OSGeo4W_ROOT\bin\o4w_env.bat : this sets up a
clean PATH, then executes all bat file in OSGeo4W_ROOT\etc\ini folder to
set up all software.
Not doing that will get you into trouble for sure.

You can simply run your Python script from an OSGeo4W shell by typing
"python path\to\your\script.py arg1 arg2 [...]"


Julien

> If I try to import otbApplication into a Python Script I get the error:
> Traceback (most recent call last):
>
>   File "<interactive input>", line 1, in <module>
>   File "C:\OSGeo4W\apps\orfeotoolbox\python\otbApplication.py", line
> 25, in <module>
>     _otbApplication = swig_import_helper()
>   File "C:\OSGeo4W\apps\orfeotoolbox\python\otbApplication.py", line
> 24, in swig_import_helper
>     return _mod
> UnboundLocalError: local variable '_mod' referenced before assignment
>
> Can annybody help me out?
> Thanks, Claire
> -- 
> -- 
> Check the OTB FAQ at
> http://www.orfeo-toolbox.org/FAQ.html
>  
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/otb-users?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to