# AttributeError: 'str' object has no attribute 'fetch'

**URL:** <https://discuss.python.org/t/attributeerror-str-object-has-no-attribute-fetch/7289>\
**Category:** Python Help\
**Created:** [February 20, 2021, 2:46pm UTC](https://discuss.python.org/t/attributeerror-str-object-has-no-attribute-fetch/7289 "2021-02-20T14:46:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![steven.daprano](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/steven.daprano/32/1083_2.png) [@steven.daprano](https://discuss.python.org/u/steven.daprano)\
**Post date:** [February 20, 2021, 10:47pm UTC](https://discuss.python.org/t/attributeerror-str-object-has-no-attribute-fetch/7289/3 "2021-02-20T22:47:47Z")

</div>

Somewhere in your code, I’m _guessing_ that you have a line like this:

```
db = 'path/to/my/database.db'

```

You need to change it to

db = Database(‘path/to/my/database.db’)

But you really should post the full traceback of the error.

---

_[View the full topic](https://discuss.python.org/t/attributeerror-str-object-has-no-attribute-fetch/7289)._
