import pywikibot

site = pywikibot.Site("ru", "wikipedia")
page = pywikibot.Page(site, "Барак Обама")
item = pywikibot.ItemPage.fromPage(page)

print(item)
---------------------------------------------------------------------------
NoPage                                    Traceback (most recent call last)
<ipython-input-4-a7e94deb9816> in <module>()
      3 site = pywikibot.Site("ru", "wikipedia")
      4 page = pywikibot.Page(site, "Барак Обама")
----> 5 item = pywikibot.ItemPage.fromPage(page)
      6 
      7 print(item)

/srv/paws/pwb/pywikibot/page.py in fromPage(cls, page, lazy_load)
   3976         i._title = page.title(withSection=False)
   3977         if not lazy_load and not i.exists():
-> 3978             raise pywikibot.NoPage(i)
   3979         return i
   3980 

NoPage: Page [[wikidata:-1]] doesn't exist.