Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception in thread django-main-thread error #419

Closed
narenpop opened this issue Aug 29, 2020 · 26 comments
Closed

exception in thread django-main-thread error #419

narenpop opened this issue Aug 29, 2020 · 26 comments

Comments

@narenpop
Copy link

Describe the problem

django_err

Tell us about the problem you're having.

I was trying to install djangorestframewok and i installed it then i had an issue running the server have attached the image file

(localdev-EUbEEbsi) C:\Users\ASUS\Desktop\localdev\ecom>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\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\base.py", line 392, in check
all_issues = checks.run_checks(
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\urls.py", line 101, in check_url_settings
if value and not value.endswith('/'):
AttributeError: 'tuple' object has no attribute 'endswith'

Steps to reproduce

Tell us how to reproduce it.

System configuration

  • Django version:
  • Python version:3.8.5
  • Django-Constance version:
@Intergalaxen
Copy link

Describe the problem

django_err

Tell us about the problem you're having.

I was trying to install djangorestframewok and i installed it then i had an issue running the server have attached the image file

(localdev-EUbEEbsi) C:\Users\ASUS\Desktop\localdev\ecom>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\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\base.py", line 392, in check
all_issues = checks.run_checks(
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\urls.py", line 101, in check_url_settings
if value and not value.endswith('/'):
AttributeError: 'tuple' object has no attribute 'endswith'

Steps to reproduce

Tell us how to reproduce it.

System configuration

  • Django version:
  • Python version:3.8.5
  • Django-Constance version:

I'm having the same issue, have u been able to fix it? If yes, how did you make it?
/Int ^^

@Chuckpy
Copy link

Chuckpy commented Feb 10, 2021

Same as mine

@uxrishu
Copy link

uxrishu commented Apr 18, 2021

getting same error but didn't get any solution yet. :-(

@2019980006
Copy link

same as mine

@naseeraslam
Copy link

same as mine can anyone help please

@Mogost
Copy link
Member

Mogost commented Apr 23, 2021

"same as mine"

Doesn't help to understand your issue at all.
Why do you think that the problem is with this library? There is no one mention of django-constance in stacktrace.

@vbonh
Copy link

vbonh commented Jun 18, 2021

For those who are facing a similar problem and land on this page.

Go to your settings.py and make sure you have a coma at the end of each lines in your installed apps, Middleware etc...

Worked for me

@Mogost Mogost closed this as completed Jun 18, 2021
@Charlie5DH
Copy link

If you have this problem, go to the settings.py file, and check for comas and if rest_framework is correctly spelled.

@AkshatPatel07
Copy link

@vbonh can you please elaborate more. Facing same problem

@Aastha-1008
Copy link

@AkshatPatel07 Are you able to solve this error?

@kwonjaeyong1
Copy link

same as mine

@AkshatPatel07
Copy link

@AkshatPatel07 Are you able to solve this error?

Yess

@command09
Copy link

Python manage.py migrate

@naseeraslam
Copy link

naseeraslam commented Jun 10, 2022 via email

@JyotsanaMehra
Copy link

JyotsanaMehra commented Aug 24, 2022

I was also facing the same issue. Check for the database which you are using is installed or not and if you are not using any databases, then go to settings.py and comment out the Database section
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}

This will resolve the issue

@Zaza2215
Copy link

Zaza2215 commented Oct 7, 2022

I ran cmd as administrator and everything worked.

@2100031431
Copy link

same issue for me and i have checked the settings.py it was perfect

@LnPaulin
Copy link

Having working on windows and when i take my app to linux, I have that issue.. everything works file on windows but when I pull it from windows to linux and run any manage.py command I have the same issue you raised on this.. any ideas ?

@Sushant0999
Copy link

I was having the same issue.
I solved it by just changing the python interpreter.
Worked for me ✔.

@aomer24
Copy link

aomer24 commented Jan 2, 2023

check the setting configration (stting.py) file

@Statesonbrown
Copy link

Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\threading.py", line 870, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\base.py", line 396, in check
databases=databases,
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\checks\registry.py", line 70, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\checks\urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\checks\urls.py", line 23, in check_resolver
return check_method()
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\urls\resolvers.py", line 408, in check
for pattern in self.url_patterns:
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\urls\resolvers.py", line 589, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\urls\resolvers.py", line 582, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "C:\Users\Z\Desktop\Attendance-System-Using-Face-Recognition\attendance_system_facial_recognition\urls.py", line 19, in
from recognition import views as recog_views
File "C:\Users\Z\Desktop\Attendance-System-Using-Face-Recognition\recognition\views.py", line 18, in
from sklearn.preprocessing import LabelEncoder
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn_init
.py", line 76, in
from .base import clone
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\base.py", line 16, in
from .utils import IS_32BIT
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\sklearn\utils_init
.py", line 13, in
from scipy.sparse import issparse
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy_init
.py", line 136, in
from . import distributor_init
File "C:\Users\Z\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy_distributor_init.py", line 61, in
WinDLL(os.path.abspath(filename))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\ctypes_init
.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

@Lizano16
Copy link

PS C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema> 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\Usuario\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\commands\runserver.py", line 133, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\management\base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\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\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\resolvers.py", line 494, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\utils\functional.py", line 57, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\resolvers.py", line 715, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\utils\functional.py", line 57, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\resolvers.py", line 708, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema\sistema\urls.py", line 24, in
path('', include('chatbot.urls')),
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\site-packages\django\urls\conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Usuario\AppData\Local\Programs\Python\Python311\Lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema\chatbot\urls.py", line 2, in
from . import views
File "C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema\chatbot\views.py", line 5, in
import openai
ModuleNotFoundError: No module named 'openai'
PS C:\Users\Usuario\OneDrive\Escritorio\libreria\sistema>

Alguien sabe por que me aparece este error

@mehdi8554
Copy link

For me solved as below:
pip unistall djangorestframework
pip install djangorestframework
that's all

@Himi-Deb
Copy link

Describe the problem

django_err

Tell us about the problem you're having.

I was trying to install djangorestframewok and i installed it then i had an issue running the server have attached the image file

(localdev-EUbEEbsi) C:\Users\ASUS\Desktop\localdev\ecom>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\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 932, in _bootstrap_inner self.run() File "c:\users\asus\appdata\local\programs\python\python38-32\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\management\base.py", line 392, in check all_issues = checks.run_checks( File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\registry.py", line 70, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\ASUS.virtualenvs\localdev-EUbEEbsi\lib\site-packages\django\core\checks\urls.py", line 101, in check_url_settings if value and not value.endswith('/'): AttributeError: 'tuple' object has no attribute 'endswith'

Steps to reproduce

Tell us how to reproduce it.

System configuration

  • Django version:
  • Python version:3.8.5
  • Django-Constance version:

I went to an earlier local version in vscode (undo on the recently deleted file)... which I am guess threw off this

"Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
self.run()
File "C:\Python312\Lib\threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)"

Checked my settings.py but don't notice anything unusual

@Bhaktims
Copy link

Bhaktims commented Mar 7, 2024

i updated the pip using command "python.exe -m pip install --upgrade pip" and then reinstalled django

@1Athar
Copy link

1Athar commented Mar 22, 2024

Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
self.run()
File "C:\Python312\Lib\threading.py", line 1010, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\management\commands\runserver.py", line 133, in inner_run
self.check(display_num_errors=True)
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\management\base.py", line 486, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\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\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver
return check_method()
^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\urls\resolvers.py", line 519, in check
for pattern in self.url_patterns:
^^^^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\utils\functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\urls\resolvers.py", line 738, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\utils\functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\Atharva\Desktop\PBL-SE\backend\Lib\site-packages\django\urls\resolvers.py", line 731, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\Atharva\Desktop\PBL-SE\captcha\captcha\urls.py", line 19, in
from . import views
ImportError: cannot import name 'views' from 'captcha' (C:\Users\Atharva\Desktop\PBL-SE\captcha\captcha_init
.py)

I am getting this error please someone help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests