Page MenuHomePhabricator

pwb wrapper raises ModuleNotFoundError due to missing setup
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

$ python3 -m venv pwbvenv
$ source pwbvenv/bin/activate
$ git clone --depth 1 --single-branch --recurse-submodules --shallow-submodules --branch stable "https://gerrit.wikimedia.org/r/pywikibot/core" $HOME/pywikibot-core
$ pip install --upgrade pip setuptools wheel
$ pip install $HOME/pywikibot-core[mwoauth,mysql]
$ pwb version

or

$ python3 -m venv pwbvenv
$ source pwbvenv/bin/activate
$ pip install pywikibot-scripts
$ pwb version

What happens?:

Traceback (most recent call last):
  File "/data/project/jjmc89-bot-dev/pwbvenv/bin/pwb", line 3, in <module>
    from pywikibot.scripts.wrapper import run
  File "/data/project/jjmc89-bot-dev/pwbvenv/lib/python3.13/site-packages/pywikibot/scripts/wrapper.py", line 297, in <module>
    if not check_modules():
           ~~~~~~~~~~~~~^^
  File "/data/project/jjmc89-bot-dev/pwbvenv/lib/python3.13/site-packages/pywikibot/scripts/wrapper.py", line 247, in check_modules
    from setup import script_deps
ModuleNotFoundError: No module named 'setup'

What should have happened instead?:

The version script should have run successfully without the wrapper raising an exception.

Details

Related Changes in Gerrit:

Event Timeline

Xqt triaged this task as High priority.Mar 14 2026, 9:35 AM

Change #1251963 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] Re-enable code entry point

https://gerrit.wikimedia.org/r/1251963

JJMC89 removed a project: Patch-For-Review.

Change #1251963 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] Re-enable code entry point

https://gerrit.wikimedia.org/r/1251963