Home > Blockchain >  Exception in thread django-main-thread Traceback
Exception in thread django-main-thread Traceback

Time:11-09

I am getting this error while trying to run a Django project. This happened when I cloned the project and run it for this first time, I am running it using a virtual environment

(env1) C:\Users\Chiam\Desktop\fyp\odyera>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\Chiam\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Users\Chiam\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run
    self.check(display_num_errors=True)
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\core\management\base.py", line 475, in check
    all_issues = checks.run_checks(
                 ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\core\checks\registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\core\checks\urls.py", line 42, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\core\checks\urls.py", line 61, in _load_all_namespaces
    url_patterns = getattr(resolver, "url_patterns", [])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\utils\functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\urls\resolvers.py", line 715, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
                       ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\utils\functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\Desktop\fyp\odyera\env1\Lib\site-packages\django\urls\resolvers.py", line 708, in urlconf_module
    return import_module(self.urlconf_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Chiam\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  File "C:\Users\Chiam\Desktop\fyp\odyera\client\views.py", line 3, in <module>
    import pyrebase
ModuleNotFoundError: No module named 'pyrebase'

Searched a lot on the internet but still couldn't find the reason why this is happening

CodePudding user response:

You are missing a package named pyrebase and its references have been used in your project. Install this package by the following instructions:

pip install pyrebase

or,

pip3 install pyrebase
  • Related