Page MenuHomePhabricator

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

Description

I have registered to Wikidata and set up https://paws.wmflabs.org/ 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 https://paws.wmflabs.org and I am also logged into https://www.mediawiki.org and https://en.wikipedia.org (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 https://commons.wikimedia.org 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.