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

'pkgutil' AttributeError #58

Open
azulu opened this issue Sep 26, 2024 · 3 comments
Open

'pkgutil' AttributeError #58

azulu opened this issue Sep 26, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@azulu
Copy link

azulu commented Sep 26, 2024

Hello,
I am encountering this AttributeError during the initialisation of the script:

Traceback (most recent call last):
  File "Upload-Assistant\upload.py", line 3, in <module>
    from src.clients import Clients
  File "Upload-Assistant\src\clients.py", line 6, in <module>
    import qbittorrentapi
  File "Upload-Assistant\L4G\Lib\site-packages\qbittorrentapi\__init__.py", line 1, in <module>
    from qbittorrentapi._version_support import Version
  File "Upload-Assistant\L4G\Lib\site-packages\qbittorrentapi\_version_support.py", line 1, in <module>
    from pkg_resources import parse_version
  File "Upload-Assistant\L4G\Lib\site-packages\pkg_resources\__init__.py", line 2313, in <module>
    register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
                               ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

All requirements.txt installed, Python version: 3.12.6.
Not quite sure how to approach this.

@Audionut
Copy link
Owner

This is one of the main reasons I hate python, they just depreciate whatever.

Can you try adding the version to the requirements text like so:

  • qbittorrent-api==2024.8.65

Then running the requirements again.

@azulu
Copy link
Author

azulu commented Sep 27, 2024

This is one of the main reasons I hate python, they just depreciate whatever.

Can you try adding the version to the requirements text like so:

* qbittorrent-api==2024.8.65

Then running the requirements again.

Still breaking. But it's a little different now...

Installing collected packages: packaging, qbittorrent-api
  Attempting uninstall: qbittorrent-api
    Found existing installation: qbittorrent-api 2023.6.50
    Uninstalling qbittorrent-api-2023.6.50:
      Successfully uninstalled qbittorrent-api-2023.6.50
Successfully installed packaging-24.1 qbittorrent-api-2024.8.65
(L4G) PS Upload-Assistant> python upload.py --help
Traceback (most recent call last):
  File "upload.py", line 4, in <module>
    from src.prep import Prep
  File "src\prep.py", line 22, in <module>
    from guessit import guessit
  File "L4G\Lib\site-packages\guessit\__init__.py", line 8, in <module>
    from .api import guessit, GuessItApi
  File "L4G\Lib\site-packages\guessit\api.py", line 17, in <module>
    from .rules import rebulk_builder
  File "L4G\Lib\site-packages\guessit\rules\__init__.py", line 11, in <module>
    from .properties.episodes import episodes
  File "L4G\Lib\site-packages\guessit\rules\properties\episodes.py", line 16, in <module>
    from .title import TitleFromPosition
  File "L4G\Lib\site-packages\guessit\rules\properties\title.py", line 11, in <module>
    from .language import (
  File "L4G\Lib\site-packages\guessit\rules\properties\language.py", line 10, in <module>
    import babelfish
  File "L4G\Lib\site-packages\babelfish\__init__.py", line 14, in <module>
    from .converters import (LanguageConverter, LanguageReverseConverter, LanguageEquivalenceConverter, CountryConverter,
  File "L4G\Lib\site-packages\babelfish\converters\__init__.py", line 5, in <module>
    from pkg_resources import iter_entry_points, EntryPoint
  File "L4G\Lib\site-packages\pkg_resources\__init__.py", line 2313, in <module>
    register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
                               ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

@azulu
Copy link
Author

azulu commented Sep 27, 2024

As a temporary workaround, what worked for me, was manually upgrading some pip dependencies.
More precisely: python -m pip install --upgrade babelfish guessit lxml.

@Audionut Audionut added the documentation Improvements or additions to documentation label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants