Page MenuHomePhabricator

Error mwoauth-invalid-authorization-invalid-user in Wikidata:Pywikibot - Python 3 Tutorial/Data Harvest
Closed, DuplicatePublic


I have registered to Wikidata and set up and logged in.
I am performing the Wikidata:Pywikibot - Python 3 Tutorial/Data Harvest.
When executing

import pywikibot

site = pywikibot.Site("en", "wikipedia")
page = pywikibot.Page(site, "Douglas Adams")
item = pywikibot.ItemPage.fromPage(page)

I get the following error message:

WARNING: API error mwoauth-invalid-authorization-invalid-user: The authorization headers in your request are for a user that does not exist here

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptFeb 21 2019, 3:10 PM

Have you tried to log into en wikipedia first?

Yes, I think so:
I am certainly logged into and I am also logged into and (my username appears on the top)

Try to login to commons and wikidata as well. I think there is a task for this bug.

BernhardHumm closed this task as Resolved.Feb 22 2019, 9:21 AM
BernhardHumm claimed this task.

Great and thank you very much!
Logging into indeed solved the problem.

As mentioned in T168222, this is not at all intuitive and should either be documented in the tutorial or be solved otherwise.