ejwa / gitinspector

:bar_chart: The statistical analysis tool for git repositories
GNU General Public License v3.0
2.34k stars 324 forks source link

ModuleNotFoundError: No module named 'localization' (python 3.9) #233

Open MikeJakubik opened 1 year ago

MikeJakubik commented 1 year ago

[root@fbsd /usr/ports/devel/gitinspector]# make install clean

===> Installing for gitinspector-py39-0.4.4_4 ===> Checking if gitinspector-py39 is already installed ===> Registering installation for gitinspector-py39-0.4.4_4 Installing gitinspector-py39-0.4.4_4... ===> Cleaning for py39-setuptools-63.1.0 ===> Cleaning for gitinspector-py39-0.4.4_4

[root@fbsd /usr/ports/devel/gitinspector]# cd

[root@fbsd ~]# gitinspector -h

Traceback (most recent call last): File "/usr/local/bin/gitinspector", line 33, in sys.exit(load_entry_point('gitinspector==0.4.4', 'console_scripts', 'gitinspector')()) File "/usr/local/bin/gitinspector", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load module = import_module(match.group('module')) File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/usr/local/lib/python3.9/site-packages/gitinspector/gitinspector.py", line 24, in import localization ModuleNotFoundError: No module named 'localization'

adam-waldenberg commented 1 year ago

Thanks. Looks like a breaking change of some sort in Python 3.9.

foxyseta commented 1 year ago

Same here. Any updates on this?

davbeek commented 1 year ago

Could be related to Python no longer supporting Python 2 as of 1 Jan 2020. Python 3.8 was released Oct 2019 and Python 3.9 in Oct 2020, so after the demise of Python 2.

Module gitinspector.localization uses Python 2 functionality in __translation__.install(True), where True is a Unicode flag used in Python 2. In Python 3, this flag is no longer present, so it should be __translation__.install(). This occurs in three places in localization.py (lines 71, 96 and 106).