I want to see "Hello django" on my Mac

Asked 2 years ago, Updated 2 years ago, 76 views

Django's server won't start. Please tell me how to resolve it.

  • Mac 10.14.4 (18E226)
  • vscode
  • Miniconda
  • django
  • python
  • Django
  • AnacondaExtensionPack
  • MagicPython

(dj)watanabekeitanoMacBook-Pro:test3watanabekeita$conda list

#packages in environment at/miniconda3/envs/dj:
#
# Name Version Build Channel
astroid 2.2.5py37_0conda-forge
autopep8 1.4.4py_0conda-forge
bzip2 1.0.6 h1de35cc_1002conda-forge
ca-certificates 2019.3.9hecc5488_0conda-forge
certifi 2019.3.9py37_0conda-forge
django 2.2py37_0conda-forge
isort 4.3.17py37_0conda-forge
lazy-object-proxy 1.3.1py37h1de35cc_1000conda-forge
libcxx 8.0.02conda-forge
libcxxabi 8.0.02conda-forge
libffi 3.2.1 h6de7cb9_1006conda-forge
mccabe 0.6.1py_1conda-forge
ncurses 6.1 h0a44026_1002conda-forge
openssl 1.1.1b h01d97ff_2conda-forge
pip19.0.3py37_0conda-forge
pycodestyle 2.5.0py_0conda-forge
pilot 2.3.1 py37_0 conda-forge
python 3.7.3 h0d93f26_0conda-forge
pytz 2019.1 py_0 conda-forge
readline 7.0 hcfe32e1_1001conda-forge
setuptools 41.0.0py37_0conda-forge
Six 1.12.0 py37_1000 conda-forge
sqlite 3.26.0 h1765d9f_1001conda-forge
tk 8.6.9 ha441bb4_1001conda-forge
wheel 0.33.1 py37_0 conda-forge
write1.11.1py37h1de35cc_0conda-forge
xz 5.2.4 h1de35cc_1001conda-forge
zlib 1.2.11 h1de35cc_1004conda-forge

(dj)watanabekeitanoMacBook-Pro:Test3watanabekeita$python manage.py runserver

Watching for file changes with StatReloader
Exception in thread Thread-1:
Traceback (most recent call last):
  File"/miniconda3/envs/dj/lib/python 3.7/threading.py", line917, in_bootstrap_inner
    self.run()
  File"/miniconda3/envs/dj/lib/python 3.7/threading.py", line865, in run
    self._target(*self._args, **self._kwargs)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
    fn(*args,**kwargs)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/core/management/commands/runserver.py", line 109, inner_run
    autoreload.raise_last_exception()
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/utils/autoreload.py", line 77, raise_last_exception
    raise_exception[0](_exception[1]).with_traceback(_exception[2])
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper
    fn(*args,**kwargs)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/_init__.py", line 24, setup
    apps.populate (settings.INSTALLED_APPS)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/apps/registry.py", line 114, impulate
    app_config.import_models()
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module=import_module(models_module_name)
  File"/miniconda3/envs/dj/lib/python3.7/importlib/_init__.py", line 127, import_module
    return_bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in_gcd_import
  File "<frozen importlib._bootstrap>", line 983, in_find_and_load
  File"<frozen importlib._bootstrap>", line 967, in_find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in_load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in_call_with_frames_removed
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/contrib/auth/models.py", line 2, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/contrib/auth/base_user.py", line 47, in<module>
    class AbstractBaseUser(models.Model):
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/models/base.py", line 117, in__new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/models/base.py", line321, in add_to_class
    value.contribute_to_class(cls,name)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/models/options.py", line 204, in attribute_to_class
    self.db_table=truncate_name(self.db_table, connection.ops.max_name_length())
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/_init__.py", line 28, in__getattr__
    return getattr (connections [DEFAULT_DB_ALIAS], item)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/utils.py", line 201, in__getitem__
    backend=load_backend(db['ENGINE'])
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/utils.py", line 110, inload_backend
    return import_module('%s.base'%backend_name)
  File"/miniconda3/envs/dj/lib/python3.7/importlib/_init__.py", line 127, import_module
    return_bootstrap._gcd_import(name[level:], package, level)
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/backends/sqlite3/base.py", line 28, in <module>
    from.introspection import DatabaseIntrospection#isort:skip
  File"/miniconda3/envs/dj/lib/python 3.7/site-packages/django/db/backends/sqlite3/introspection.py", line 4, in <module>
    import sqlparse
ModuleNotFoundError: No module named'sqlparse'

python macos django miniconda

2022-09-30 21:39

1 Answers

In the last sentence of the error,

ModuleNotFoundError: No module named'sqlparse'
Module 'sqlparse' not found

Run conda install sqlparse as it says.If successful, the current error will be resolved.


2022-09-30 21:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.