Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.woob cannot be used as a CLI application #310635

Closed
augustebaum opened this issue May 10, 2024 · 2 comments
Closed

python3Packages.woob cannot be used as a CLI application #310635

augustebaum opened this issue May 10, 2024 · 2 comments

Comments

@augustebaum
Copy link
Contributor

Describe the bug

When used through the command line, woob complains about imports and fails.

Steps To Reproduce

$ nix shell nixpkgs#python3Packages.woob

$ woob
usage: woob [--version] <command> [<args>]

Use one of this commands:
   bands           (unable to load: No module named 'woob_applications')
   bank            (unable to load: No module named 'woob_applications')
   bill            (unable to load: No module named 'woob_applications')
   books           (unable to load: No module named 'woob_applications')
   bugtracker      (unable to load: No module named 'woob_applications')
   calendar        (unable to load: No module named 'woob_applications')
   cinema          (unable to load: No module named 'woob_applications')
   cli             (unable to load: No module named 'woob_applications')
   config          (unable to load: No module named 'woob_applications')
   contentedit     (unable to load: No module named 'woob_applications')
   dating          (unable to load: No module named 'woob_applications')
   debug           (unable to load: No module named 'woob_applications')
   gallery         (unable to load: No module named 'woob_applications')
   gauge           (unable to load: No module named 'woob_applications')
   geolocip        (unable to load: No module named 'woob_applications')
   housing         (unable to load: No module named 'woob_applications')
   job             (unable to load: No module named 'woob_applications')
   lyrics          (unable to load: No module named 'woob_applications')
   money           (unable to load: No module named 'woob_applications')
   msg             (unable to load: No module named 'woob_applications')
   parcel          (unable to load: No module named 'woob_applications')
   paste           (unable to load: No module named 'woob_applications')
   pricecompare    (unable to load: No module named 'woob_applications')
   radio           (unable to load: No module named 'woob_applications')
   recipes         (unable to load: No module named 'woob_applications')
   repos           (unable to load: No module named 'woob_applications')
   rpg             (unable to load: No module named 'woob_applications')
   shop            (unable to load: No module named 'woob_applications')
   smtp            (unable to load: No module named 'woob_applications')
   subtitles       (unable to load: No module named 'woob_applications')
   torrent         (unable to load: No module named 'woob_applications')
   translate       (unable to load: No module named 'woob_applications')
   travel          (unable to load: No module named 'woob_applications')
   video           (unable to load: No module named 'woob_applications')
   weather         (unable to load: No module named 'woob_applications')

For more information about a command, use:
   $ man woob-<command>
or
   $ woob <command> --help

$ woob bank
Traceback (most recent call last):
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/launcher.py", line 52, in load_app
    app_module = importlib.import_module("woob.applications.%s" % app)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/gd3shnza1i50zn8zs04fa729ribr88m9-python3-3.11.8/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/applications/bank/__init__.py", line 19, in <module>
    from .bank import Appbank
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/applications/bank/bank.py", line 29, in <module>
    from woob.core.bcall import CallErrors
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/core/__init__.py", line 21, in <module>
    from .woob import Woob, WoobBase
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/core/woob.py", line 31, in <module>
    from woob.core.modules import ModulesLoader, RepositoryModulesLoader
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/core/modules.py", line 26, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/bin/.woob-wrapped", line 9, in <module>
    sys.exit(Launcher.run())
             ^^^^^^^^^^^^^^
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/launcher.py", line 106, in run
    return cls.run_app(sys.argv[1], sys.argv[2:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/launcher.py", line 60, in run_app
    app_class = cls.load_app(app)
                ^^^^^^^^^^^^^^^^^
  File "/nix/store/9h14mlz6gn9mzss5gmb848ms051ap5lm-python3.11-woob-3.6/lib/python3.11/site-packages/woob/launcher.py", line 54, in load_app
    app_module = importlib.import_module("woob_applications.%s" % app)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/gd3shnza1i50zn8zs04fa729ribr88m9-python3-3.11.8/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'woob_applications'

Notify maintainers

@DamienCassou

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 6.6.26, NixOS, 24.05 (Uakari), 24.05.20240412.cfd6b5f`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.18.2`
- channels(root): `"home-manager-23.05.tar.gz, nixos-23.05"`
- nixpkgs: `/nix/store/yy5l09gfsagkv8rswblknmsjc2gyr20d-source`

Add a 👍 reaction to issues you find important.

@augustebaum
Copy link
Contributor Author

@DamienCassou I've opened #310826 but haven't had the time to test it quite yet. If you get around to it before me feel free to merge it

@DamienCassou DamienCassou mentioned this issue May 12, 2024
13 tasks
@DamienCassou
Copy link
Contributor

I suggest another fix in #311014.

@nbraud nbraud closed this as completed in 581aee4 May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants