dimitrismistriotis / alt-profanity-check

A fast, robust library to check for offensive language in strings, dropdown replacement of "profanity-check".
https://pypi.org/project/alt-profanity-check/
MIT License
68 stars 15 forks source link

Getting error when running django server #28

Closed jslovern391 closed 10 months ago

jslovern391 commented 12 months ago

Exception in thread django-main-thread: Traceback (most recent call last): File "D:\Programs\Python\Python312\Lib\threading.py", line 1052, in _bootstrap_inner self.run() File "D:\Programs\Python\Python312\Lib\threading.py", line 989, in run self._target(*self._args, *self._kwargs) File "D:\Programs\Python\Python312\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(args, **kwargs) File "D:\Programs\Python\Python312\Lib\site-packages\django\core\management\commands\runserver.py", line 133, in inner_run
self.check(display_num_errors=True) File "D:\Programs\Python\Python312\Lib\site-packages\django\core\management\base.py", line 485, in check all_issues = checks.run_checks( ^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks new_errors = check(app_configs=app_configs, databases=databases) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\core\checks\urls.py", line 42, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\core\checks\urls.py", line 61, in _load_all_namespaces url_patterns = getattr(resolver, "url_patterns", []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\utils\functional.py", line 57, in get res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\urls\resolvers.py", line 715, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) ^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\utils\functional.py", line 57, in get res = instance.dict[self.name] = self.func(instance) ^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\urls\resolvers.py", line 708, in urlconf_module return import_module(self.urlconf_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\importlib__init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1325, in _find_and_load_unlocked File "", line 929, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "D:\OneDrive\RockTech\Django Projects\m28t\m28t\urls.py", line 26, in path("accounts/", include("accounts.urls")), ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\site-packages\django\urls\conf.py", line 38, in include urlconf_module = import_module(urlconf_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programs\Python\Python312\Lib\importlib__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1381, in _gcd_import File "", line 1354, in _find_and_load File "", line 1325, in _find_and_load_unlocked File "", line 929, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "D:\OneDrive\RockTech\Django Projects\m28t\accounts\urls.py", line 1, in from . import views File "D:\OneDrive\RockTech\Django Projects\m28t\accounts\views.py", line 20, in from profanity_check import predict File "D:\Programs\Python\Python312\Lib\site-packages\profanity_check\init__.py", line 1, in from .profanity_check import predict, predict_prob File "D:\Programs\Python\Python312\Lib\site-packages\profanity_check\profanity_check.py", line 2, in import pkg_resources ModuleNotFoundError: No module named 'pkg_resources'

menkotoglou commented 11 months ago

Thanks for reporting @jslovern391, would you be able to share your requirements.txt file or python and django versions you're using.

menkotoglou commented 11 months ago

Also, @jslovern391 can you please make sure that you use alt-profanity-check (the library here) and not the profanity-check (the legacy one)

dimitrismistriotis commented 11 months ago

@menkotoglou Canot yet test with 3.12: https://github.com/dimitrismistriotis/alt-profanity-check/pull/29

dimitrismistriotis commented 11 months ago

Update: We added Python3.12 to the test matrix and tests pass, with that in mind @jslovern391 I am very confident you have installed the initial package.

dimitrismistriotis commented 10 months ago

Closing due to inactivity plus think we detected the cause of the issue. Nice that we added Python3.12 to the check matrix.