# OTB error message in Python

**URL:** <https://forum.orfeo-toolbox.org/t/otb-error-message-in-python/1006>\
**Category:** OTB Usage\
**Created:** [April 6, 2021, 11:51pm UTC](https://forum.orfeo-toolbox.org/t/otb-error-message-in-python/1006 "2021-04-06T23:51:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![atiq](https://forum.orfeo-toolbox.org/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@atiq](https://forum.orfeo-toolbox.org/u/atiq)\
**Post date:** [April 6, 2021, 11:51pm UTC](https://forum.orfeo-toolbox.org/t/otb-error-message-in-python/1006/1 "2021-04-06T23:51:24Z")

</div>

Hi,

I am trying to do object-based segmentation of satellite imagery using OTB in Python. I have python 3.5.1 and OTB 7.2.0 installed on my computer. This is how I set up the path and environment for using OTB in python.

 ![aaa](https://forum.orfeo-toolbox.org/uploads/default/original/1X/376c4939203f7ce63b34c3eb3dabd4f22322a6d0.jpeg)

While I was testing the OTB application in python, it gives me the following error.

![Capture2](https://forum.orfeo-toolbox.org/uploads/default/original/1X/8aa9c4ecdd02c90ba32cdb70ae3407b9a4930e4b.jpeg)

Any kind of help would be greatly appreciated. Please help me out by providing some ideas. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Cedric](https://forum.orfeo-toolbox.org/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@Cedric](https://forum.orfeo-toolbox.org/u/Cedric)\
**Post date:** [April 7, 2021, 7:20am UTC](https://forum.orfeo-toolbox.org/t/otb-error-message-in-python/1006/2 "2021-04-07T07:20:25Z")

</div>

Hello,

I think the `PYTHONPATH` variable should be set to `"[...]\OTB-7.2.0-Win64\lib\otb\python"` instead of `"[...]\OTB-7.2.0-Win64\lib\python"`

Cédric

---

<div class="post-metadata">

**Author:** ![atiq](https://forum.orfeo-toolbox.org/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@atiq](https://forum.orfeo-toolbox.org/u/atiq)\
**Post date:** [April 7, 2021, 1:18pm UTC](https://forum.orfeo-toolbox.org/t/otb-error-message-in-python/1006/3 "2021-04-07T13:18:49Z")

</div>

Hi Cedric,

Thanks for your reply. There is no folder named python under otb. Python folder is located under lib. Any other suggestions? Please note that it works on my laptop but not on my university computer.

---

<div class="post-metadata">

**Author:** ![frazucca](https://forum.orfeo-toolbox.org/user_avatar/forum.orfeo-toolbox.org/frazucca/32/288_2.png) [@frazucca](https://forum.orfeo-toolbox.org/u/frazucca)\
**Post date:** [April 10, 2021, 4:22pm UTC](https://forum.orfeo-toolbox.org/t/otb-error-message-in-python/1006/4 "2021-04-10T16:22:02Z")

</div>

Hi Atiq  
may be a quite stupid observation and useless, but seems to me the your PYTHONPATH variable is forerun by a space.  
Of course …good luck!!

fz
