import pywikibot #tell python that we will be using pywikibot
site=pywikibot.Site('wikidata','wikidata') #Identify the site we will use
repo=site.data_repository()                #Identify the repository
wd = pywikibot.ItemPage(repo, 'Q56095936') #Identify the wanted object in WikiData
wd.get()                                   #Get the information for the object
print('%s' % wd.labels)
print('%s' % wd.descriptions['nl'])        # Gives the description in Dutch
                                           # Raises an exception if not existing
WARNING: API error mwoauth-invalid-authorization-invalid-user: The authorization headers in your request are for a user that does not exist here
---------------------------------------------------------------------------
NoUsername                                Traceback (most recent call last)
<ipython-input-1-b9de698b97aa> in <module>()
      2 site=pywikibot.Site('wikidata','wikidata') #Identify the site we will use
      3 repo=site.data_repository()                #Identify the repository
----> 4 wd = pywikibot.ItemPage(repo, 'Q56095936') #Identify the wanted object in WikiData
      5 wd.get()                                   #Get the information for the object
      6 print('%s' % wd.labels)

/srv/paws/pwb/pywikibot/page.py in __init__(self, site, title, ns)
   4313         """
   4314         if ns is None:
-> 4315             ns = site.item_namespace
   4316         # Special case for empty item.
   4317         if title is None or title == '-1':

/srv/paws/pwb/pywikibot/site.py in item_namespace(self)
   7442         """
   7443         if self._item_namespace is None:
-> 7444             self._cache_entity_namespaces()
   7445 
   7446         if isinstance(self._item_namespace, Namespace):

/srv/paws/pwb/pywikibot/site.py in _cache_entity_namespaces(self)
   7423         self._property_namespace = False
   7424 
-> 7425         for namespace in self.namespaces.values():
   7426             if not hasattr(namespace, 'defaultcontentmodel'):
   7427                 continue

/srv/paws/pwb/pywikibot/site.py in namespaces(self)
   1021         """Return dict of valid namespaces on this wiki."""
   1022         if not hasattr(self, '_namespaces'):
-> 1023             self._namespaces = NamespacesDict(self._build_namespaces())
   1024         return self._namespaces
   1025 

/srv/paws/pwb/pywikibot/site.py in _build_namespaces(self)
   2643         # For versions lower than 1.14, APISite needs to override
   2644         # the defaults defined in Namespace.
-> 2645         is_mw114 = self.mw_version >= '1.14'
   2646 
   2647         for nsdata in self.siteinfo.get('namespaces', cache=False).values():

/srv/paws/pwb/pywikibot/site.py in mw_version(self)
   2777         mw_ver, cache_time = getattr(self, '_mw_version_time', (None, None))
   2778         if mw_ver is None or time.time() - cache_time > 60 * 60 * 24:
-> 2779             mw_ver = MediaWikiVersion(self.version())
   2780             setattr(self, '_mw_version_time', (mw_ver, time.time()))
   2781         return mw_ver

/srv/paws/pwb/pywikibot/site.py in version(self)
   2760             try:
   2761                 version = self.siteinfo.get('generator',
-> 2762                                             expiry=1).split(' ')[1]
   2763             except pywikibot.data.api.APIError:
   2764                 # May occur if you are not logged in (no API read permissions).

/srv/paws/pwb/pywikibot/site.py in get(self, key, get_default, cache, expiry)
   1670                 elif not Siteinfo._is_expired(cached[1], expiry):
   1671                     return copy.deepcopy(cached[0])
-> 1672         preloaded = self._get_general(key, expiry)
   1673         if not preloaded:
   1674             preloaded = self._get_siteinfo(key, expiry)[key]

/srv/paws/pwb/pywikibot/site.py in _get_general(self, key, expiry)
   1616                     .format("', '".join(props)), _logger)
   1617             props += ['general']
-> 1618             default_info = self._get_siteinfo(props, expiry)
   1619             for prop in props:
   1620                 self._cache[prop] = default_info[prop]

/srv/paws/pwb/pywikibot/site.py in _get_siteinfo(self, prop, expiry)
   1539         request._warning_handler = warn_handler
   1540         try:
-> 1541             data = request.submit()
   1542         except api.APIError as e:
   1543             if e.code == 'siunknown_siprop':

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2426         cached_available = self._load_cache()
   2427         if not cached_available:
-> 2428             self._data = super(CachedRequest, self).submit()
   2429             self._write_cache(self._data)
   2430         else:

/srv/paws/pwb/pywikibot/data/api.py in submit(self)
   2253                     continue
   2254                 raise NoUsername('Failed OAuth authentication for %s: %s'
-> 2255                                  % (self.site, info))
   2256             if code == 'cirrussearch-too-busy-error':  # T170647
   2257                 self.wait()

NoUsername: Failed OAuth authentication for wikidata:wikidata: The authorization headers in your request are for a user that does not exist here