[BUG] ModuleNotFoundError: No module named 'pkg_resources
Description
On OpenBSD, executing steamctl depot download -os linux64 -a 1637730 gives ModuleNotFoundError: No module named 'pkg_resources
Steps to Reproduce the behavior
$ uname -a
OpenBSD sentinel.lan 7.5 GENERIC.MP#82 amd6
$ steamctl --version
steamctl 0.9.5
$ steamctl depot download -os linux64 -a 1760770
Traceback (most recent call last):
File "/usr/local/bin/steamctl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/steamctl/__main__.py", line 52, in main
cmd_func = getattr(import_module(subpkg), func)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/site-packages/steamctl/commands/depot/gcmds.py", line 3, in <module>
gevent.monkey.patch_socket()
File "/usr/local/lib/python3.10/site-packages/gevent/monkey.py", line 198, in ignores
from gevent.events import DoNotPatch
File "/usr/local/lib/python3.10/site-packages/gevent/events.py", line 74, in <module>
from pkg_resources import iter_entry_points
ModuleNotFoundError: No module named 'pkg_resources
Expected behavior
It downloads the game.
What actually happend
It does not download the game.
Logs
steamctl -l debug
$ steamctl -l debug
[DEBUG] steamctl: Parsed args: {'versions_report': None, 'log_level': 'debug', 'anonymous': False, 'user': None, 'password': None, 'command': None, '_cmd_func': <function generate_parser.<locals>.print_help at 0x131bbc25ab0>}
usage: steamctl [-h] [--version] [--versions-report] [-l {quiet,info,debug}]
[--anonymous] [--user USER] [--password PASSWORD]
<command> ...
options:
-h, --help show this help message and exit
--version show program's version number and exit
--versions-report show detailed versions report and exit
-l {quiet,info,debug}, --log_level {quiet,info,debug}
Set logging level
--anonymous Anonymous Steam login
--user USER Username for Steam login
--password PASSWORD Password for Steam login
List of commands:
<command>
apps Get information about apps
assistant Helpful automation
authenticator Manage Steam authenticators
clear Remove data stored on disk
cloud Manage Steam Cloud files (e.g. save files, settings,
etc)
depot List and download from Steam depots
hlmaster Query master server and server information
steamid Parse SteamID representations
ugc Info and download of user generated content
webapi Access to WebAPI
workshop Search and download workshop items
Tab Completion
Additional steps are needed to activate bash tab completion.
See https://argcomplete.readthedocs.io/en/latest/#global-completion
To enable globally run:
activate-global-python-argcomplete
To enable for the current session run:
eval "$(register-python-argcomplete steamctl)"
The above code can be added to .bashrc to persist between sessions for the user.
Versions Report
steamctl --versions-report
(Run steamctl --versions-report and paste the output below)$ steamctl --versions-report
steamctl: 0.9.5
Dependencies:
Traceback (most recent call last):
File "/usr/local/bin/steamctl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/steamctl/__main__.py", line 19, in main
args, _ = parser.parse_known_args()
File "/usr/local/lib/python3.10/argparse.py", line 1866, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "/usr/local/lib/python3.10/argparse.py", line 2079, in _parse_known_args
start_index = consume_optional(start_index)
File "/usr/local/lib/python3.10/argparse.py", line 2019, in consume_optional
take_action(action, args, option_string)
File "/usr/local/lib/python3.10/argparse.py", line 1943, in take_action
action(self, namespace, argument_values, option_string)
File "/usr/local/lib/python3.10/site-packages/steamctl/argparser.py", line 31, in __call__
versions_report()
File "/usr/local/lib/python3.10/site-packages/steamctl/utils/versions_report.py", line 17, in versions_report
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Maybe try with Python 3.9.
CC @sthen who seems to be a maintainer of the OpenBSD ports tree. The package steamctl is only intended to work with at most Python 3.9, but it is using Python 3.11 as per this commit message.
The reported problem is because steamctl uses pkg_resources ("deprecated in favor of importlib.resources, importlib.metadata and their backports" according to setuptools docs) so it needs setuptools to be installed at runtime. I'll get that dependency added to the port but in the meantime @nalzok please try "pkg_add py3-setuptools" - it will get past this problem - and see if steamctl then works.
If there are other issues relating to newer Python versions they'll need to be patched, hopefully it will be ok anyway though because most OS have moved past Python 3.9 by now.
It works after I upgrade to 0.9.5p0. Thanks for the help, everyone!