Skip to content

Can't run WikibaseSync #20

@Podbrushkin

Description

@Podbrushkin
  • Operating system: Windows 10
  • Python 3.10.8

Hello, I can't run your application - python import_one.py Q2 fails with TypeError: 'NoneType' object is not subscriptable error.
I have no expirience with Python or venv, how to launch virtual environment I've found here and here is what I've did:

git clone https://github.com/the-qa-company/WikibaseSync.git
cd WikibaseSync
*created bot, changed 3 config files*
python -m venv .
.\Scripts\activate.bat
pip install -r requirements.txt
python import_one.py Q2

It brings this output:

Traceback (most recent call last):
  File "C:\WikibaseLocal\WikibaseSync\import_one.py", line 17, in <module>
    wikibase_importer = WikibaseImporter(wikibase_repo,wikidata_repo)
  File "C:\WikibaseLocal\WikibaseSync\util\util.py", line 22, in __init__
    self.identifier.get(wikibase_repo)
  File "C:\WikibaseLocal\WikibaseSync\util\PropertyWikidataIdentifier.py", line 32, in get
    wikibase_item.editEntity(data, summary=u'Insert a property to have a wikidata identifier')
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\page\_decorators.py", line 50, in wrapper
    handle(func, self, *args, **kwargs)
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\page\_decorators.py", line 29, in handle
    func(self, *args, **kwargs)
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\page\__init__.py", line 3662, in editEntity
    super().editEntity(data, **kwargs)
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\page\__init__.py", line 3413, in editEntity
    updates = self.repo.editEntity(
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\tools\__init__.py", line 1478, in wrapper
    return obj(*__args, **__kw)
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\site\_decorators.py", line 93, in callee
    return fn(self, *args, **kwargs)
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\site\_datasite.py", line 333, in editEntity
    params['token'] = self.tokens['edit']
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\site\_tokenwallet.py", line 58, in __getitem__
    key = self.site.validate_tokens([key])[0]
  File "C:\WikibaseLocal\WikibaseSync\lib\site-packages\pywikibot\site\_apisite.py", line 1537, in validate_tokens
    types_wiki_old = self._paraminfo.parameter('query+info',
TypeError: 'NoneType' object is not subscriptable
CRITICAL: Exiting due to uncaught exception <class 'TypeError'>

At first I've tried to run python import_one.py Q2 without setting up virtual environment, and it resulted with the same error.
Also I'm not quite understand what values should have entityUri and propertyUri variables in application.config.ini file. My WIKIBASE_HOST var in .env file has a 192.168.1.3 value and is accessible in browser via localhost and 192.168.1.3, but 192.168.1.3/entity brings 404 error. Items are available through http://localhost/wiki/Item:Q1 or http://192.168.1.3/wiki/Special:EntityPage/Q1. Is there a way to consistently determine what values should be used for entityUri and propertyUri variables?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions