Error with Django using poetry env when I try to run tests

I have this error with Django using poetry env when I try to run tests only with this command:

python manage.py test

    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/moegts/.pyenv/versions/3.9.5/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/moegts/python/snacks_crud_project/.venv/lib/python3.9/site-packages/django/core/management/commands/test.py", line 6, in <module>
    from django.test.runner import get_max_test_processes
  File "/home/moegts/python/snacks_crud_project/.venv/lib/python3.9/site-packages/django/test/runner.py", line 2, in <module>
    import ctypes
  File "/home/moegts/.pyenv/versions/3.9.5/lib/python3.9/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

I did reinstall all the setup for the WSL & Ubuntu etc and that didn't solve the problem

Back to Top