jleclanche / python-bna

Python implementation of the mobile Blizzard Authenticator (TOTP)
https://eu.battle.net/support/en/article/24520
MIT License
256 stars 38 forks source link

BNA fails using Python 3.12.0 #40

Closed dgnuff closed 11 months ago

dgnuff commented 11 months ago

Transcript of a Windows terminal session:

18:15 c:\etc\python>python --version
Python 3.12.0

18:16 c:\etc\python>pip install bna
Collecting bna
  Using cached bna-5.1.0-py3-none-any.whl (10 kB)
Requirement already satisfied: click<9.0.0,>=8.0.3 in c:\etc\python312\lib\site-packages (from bna) (8.1.7)
Requirement already satisfied: pyotp<3.0.0,>=2.6.0 in c:\etc\python312\lib\site-packages (from bna) (2.9.0)
Requirement already satisfied: colorama in c:\etc\python312\lib\site-packages (from click<9.0.0,>=8.0.3->bna) (0.4.6)
Installing collected packages: bna
Successfully installed bna-5.1.0

[notice] A new release of pip is available: 23.2.1 -> 23.3.2
[notice] To update, run: python.exe -m pip install --upgrade pip

18:16 c:\etc\python>bna new
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Etc\Python312\Scripts\bna.exe\__main__.py", line 4, in <module>
  File "C:\Etc\Python312\Lib\site-packages\bna\__init__.py", line 10, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

18:16 c:\etc\python>

Note that trying to install the missing module fails:

18:16 c:\etc\python>pip install pkg_resources
ERROR: Could not find a version that satisfies the requirement pkg_resources (from versions: none)
ERROR: No matching distribution found for pkg_resources

[notice] A new release of pip is available: 23.2.1 -> 23.3.2
[notice] To update, run: python.exe -m pip install --upgrade pip

18:19 c:\etc\python>
dgnuff commented 11 months ago

Fixed by running pip install setuptools.

I would STRONGLY recommend that this step be included as part of the setup instructions in Readme.md

Now that this issue is fixed, I'm now running into the problem listed here: https://github.com/jleclanche/python-bna/issues/39