# AttributeError: 'str' object has no attribute 'set\_playbook\_basedir'.

**URL:** <https://forum.ansible.com/t/attributeerror-str-object-has-no-attribute-set-playbook-basedir/18749>\
**Category:** Ansible Project\
**Created:** [July 13, 2015, 9:57pm UTC](https://forum.ansible.com/t/attributeerror-str-object-has-no-attribute-set-playbook-basedir/18749 "2015-07-13T21:57:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ananth.vkg](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ananth.vkg](https://forum.ansible.com/u/ananth.vkg)\
**Post date:** [July 13, 2015, 9:57pm UTC](https://forum.ansible.com/t/attributeerror-str-object-has-no-attribute-set-playbook-basedir/18749/1 "2015-07-13T21:57:15Z")

</div>

Hi,

I am trying to execute unusable playbook using unusable python API, but the execution call to playbook.PlayBook fails with …lib/python2.7/site-packages/ansible/playbook/ **init**.py", line 173, in **init**  
inventory.set\_playbook\_basedir(self.basedir) AttributeError: ‘str’ object has no attribute ‘set\_playbook\_basedir’.

pb = playbook.PlayBook(  
playbook=playbook\_name,  
stats=stats,  
callbacks=playbook\_cb,  
runner\_callbacks=runner\_cb,  
inventory = inventory\_file)

Kindly let me know if more information is needed.

Thanks,  
Durai G

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 13, 2015, 10:11pm UTC](https://forum.ansible.com/t/attributeerror-str-object-has-no-attribute-set-playbook-basedir/18749/2 "2015-07-13T22:11:09Z")

</div>

you want to hit the development mailing list (ansible-devel) for this  
kind of questions
