On Friday, August 10, 2018 at 6:18:17 PM UTC+2, Hendrik Bernert wrote:
>
> Shall I then delete the otb-path from the PYTHONPATH variable?
>
Actually I don't know if that would work for you. issue is python binaries 
in OTB are compatible with only specific versions of OTB. If luckly, your 
system may have one and all works as planned.
you can change the order or setting PYTHONPATH. i.e first set other 
pythonpath and then OTB python bindings.

Here is the current situation in otbnenv.bat
https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/blob/develop/Packaging/Files/otbenv.bat#L26

set PYTHONPATH=%CURRENT_SCRIPT_DIR%lib\python;%PYTHONPATH%
change this to:
set PYTHONPATH=%PYTHONPATH%;%CURRENT_SCRIPT_DIR%lib\python

That might work.

Another option is to avoid otb python bindings. you can call otbcli_APP 
directly which gives same thing. 
roll a simple python class that can create application and call subprocess 
under the hood

class otbApplication(object):
 def __init__(self, name):
    pass
 def Execute(self):
    subprocess.call(["otbcli_" + self.name, ''.join(parameter_list)])

app = otbApplication("TrainImagesClassifier")
app.Execute()

The above snippet is to give an idea to skip python bindings and directly 
use cli in a pythonic way. It does all the same dll loading stuff but you 
avoid errors such as above.
One minor issue is that you have to give up chaining apps which I don't 
think is too much to leave

>
> Am Montag, 16. Juli 2018 14:37:47 UTC+2 schrieb Hendrik Bernert:
>>
>>
>> Hi there,
>>
>> I have the same problem as described (but not solved) here 
>> <https://groups.google.com/forum/#!searchin/otb-users/import%7Csort:date/otb-users/DtHrZgyzbGI/omwJyg5bCgAJ>.
>>  
>> I can run the GUI and python obviously can locate the path to 
>> otbApplciation.py, but I get this error message:
>>
>> Traceback (most recent call last):
>>   File "<input>", line 1, in <module>
>>   File "C:\Program Files\JetBrains\PyCharm Community Edition 
>> 2018.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in 
>> do_import
>>     module = self._system_import(name, *args, **kwargs)
>>   File "C:\Program 
>> Files\OrfeoToolbox\OTB-6.6.0-Win64\lib\python\otbApplication.py", line 21
>> , in <module>
>>     _otbApplication = swig_import_helper()
>>   File "C:\Program 
>> Files\OrfeoToolbox\OTB-6.6.0-Win64\lib\python\otbApplication.py", line 20
>> , in swig_import_helper
>>     return importlib.import_module('_otbApplication')
>>   File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
>>     __import__(name)
>>   File "C:\Program Files\JetBrains\PyCharm Community Edition 
>> 2018.1.3\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 19, in 
>> do_import
>>     module = self._system_import(name, *args, **kwargs)
>> ImportError: DLL load failed: Die angegebene Prozedur wurde nicht 
>> gefunden.
>>
>> I tried everything, from removing and setting all the environment 
>> variables as described in the post or listed in the otbenv.bat to 
>> restarting the computer for the changes to take place, but nothing worked. 
>> Is there anything I'm missing? Where do I have to point to the dll's, which 
>> for me are located here:
>>
>> c:\Program Files\OrfeoToolbox\OTB-6.6.0-Win64\bin\
>>
>> I'm running on a machine with Windows 10, 64bit, have the OTB installed 
>> with 64bit and Python 2.7 with 64bit architecture (yes, I'm sure about 
>> that). I also have GDAL installed under 
>>
>> C:\Program Files\GDAL\
>>
>> Any help is much appreciated, thanks in advance!
>>
>

-- 
-- 
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 otb-users@googlegroups.com
To unsubscribe from this group, send email to
otb-users+unsubscr...@googlegroups.com
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 otb-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to