Page MenuHomePhabricator

Can't run pywikibot script on Toolforge
Closed, InvalidPublic

Description

One of my tool-account today that it cannot run pywikibot scripts. The last time I run this script was on April 16th. I have not made any modifications to this pywikibot script during this period, nor have I made any changes to the running environment in this tool-account.

(rcenv3)wikishizhao@tools-bastion-13:~$ become redpanda
(flickr) tools.redpanda@tools-bastion-13:~$ python3 ./pywikibot/pwb.py flickrcheck.py -n:2 -log
Traceback (most recent call last):
  File "/mnt/nfs/labstore-secondary-tools-project/redpanda/./pywikibot/pwb.py", line 239, in <module>
    if not check_modules():
           ^^^^^^^^^^^^^^^
  File "/mnt/nfs/labstore-secondary-tools-project/redpanda/./pywikibot/pwb.py", line 183, in check_modules
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
(flickr) tools.redpanda@tools-bastion-13:~$ ls ./flickr/lib/python3.*/site-packages
__pycache__                          pkg_resources
certifi                              pkg_resources-0.0.0.dist-info
certifi-2021.10.8.dist-info          requests
charset_normalizer                   requests-2.27.1.dist-info
charset_normalizer-2.0.12.dist-info  requests_oauthlib
easy_install.py                      requests_oauthlib-1.3.1.dist-info
flickrapi                            requests_toolbelt
flickrapi-2.4.0.dist-info            requests_toolbelt-0.9.1.dist-info
idna                                 setuptools
idna-3.3.dist-info                   setuptools-40.8.0.dist-info
mwparserfromhell                     six-1.16.0.dist-info
mwparserfromhell-0.6.4.dist-info     six.py
oauthlib                             urllib3
oauthlib-3.2.0.dist-info             urllib3-1.26.9.dist-info
pip                                  wheel
pip-23.1.2.dist-info                 wheel-0.37.1.dist-info
(flickr) tools.redpanda@tools-bastion-13:~$ python3 pwb version
python3: can't open file '/mnt/nfs/labstore-secondary-tools-project/redpanda/pwb': [Errno 2] No such file or directory
(flickr) tools.redpanda@tools-bastion-13:~$ pwb version
-bash: pwb: command not found
(flickr) tools.redpanda@tools-bastion-13:~$ python3 ./pywikibot/pwb.py version
Traceback (most recent call last):
  File "/mnt/nfs/labstore-secondary-tools-project/redpanda/./pywikibot/pwb.py", line 239, in <module>
    if not check_modules():
           ^^^^^^^^^^^^^^^
  File "/mnt/nfs/labstore-secondary-tools-project/redpanda/./pywikibot/pwb.py", line 183, in check_modules
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
(flickr) tools.redpanda@tools-bastion-13:~$

Event Timeline

Shizhao updated the task description. (Show Details)
JJMC89 removed a project: Toolforge.
JJMC89 subscribed.

That venv is for python3.7, but you are using python3.11.

Also, you should not be running noninteractive processes on the bastion servers.