I started learning Django recently.
I first ran the virtual enviroment, then installed Django and then python manage.py runserverbut im recieving this error:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner
self.run()
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\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 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'allauth'
Traceback (most recent call last):
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 61, in execute
super().execute(*args, **options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\base.py", line 371, in execute
output = self.handle(*args, **options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 96, in handle
self.run(**options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\core\management\commands\runserver.py", line 103, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 618, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 603, in start_django
reloader.run(django_main_thread)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 318, in run
self.run_loop()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 324, in run_loop
next(ticker)
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 364, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 380, in snapshot_files
for file in self.watched_files():
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 278, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 105, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\123\Downloads\django-react-boilerplate-master\django-react-boilerplate-master\env\lib\site-packages\django\utils\autoreload.py", line 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1204, in resolve
s = self._flavour.resolve(self, strict=strict)
File "C:\Users\123\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 200, in resolve
return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
I downloaded this https://github.com/justdjango/django-react-boilerplate project and was trying to run this in the terminal.
If someone can help please. Thankyou.
The problem is in your setup. After activating your environment, run this command;
pip install -r requirements.txt
As you downloaded the code from the mentioned link, that also has a file, requirements.txt which shows all the modules required to make the project run and the above command will install all of them at once.
After that run;
python manage.py makemigrations
python manage.py migrate
Then you will be ready;
python manage.py ruunserver
Related
I am new to Django so please excuse my ignorance...
I have been working on an e-commerce project with django in VS code. Everything was working fine until I thought I'd add an account feature. From the terminal I did a startapp account. Not long after doing this, I decided to go another route and not make an account app. So I deleted the account directory from the explorer from right clicking and selecting the delete option. Now, when I ran the server to make sure I didn't break anything, I did in fact break everything. I am using the venv and I do have my Onedrive open since the directory is saved in there. This is the error I got:
(Django_projects) PS C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify> py manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "c:\users\kylec\appdata\local\programs\python\python39\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "c:\users\kylec\appdata\local\programs\python\python39\lib\threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\__init__.py",
line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\apps\config.py", line 193, in
create
import_module(entry)
File "c:\users\kylec\appdata\local\programs\python\python39\lib\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 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'account'
Traceback (most recent call last):
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 22, in <module>
main()
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\__init__.py",
line 446, in execute_from_command_line
utility.execute()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\__init__.py",
line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 74, in execute
super().execute(*args, **options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\base.py", line 448, in execute
output = self.handle(*args, **options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 111, in handle
self.run(**options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\core\management\commands\runserver.py", line 118, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 680, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 661, in start_django
reloader.run(django_main_thread)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 344, in run
self.run_loop()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 350, in run_loop
next(ticker)
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 390, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 411, in snapshot_files
for file in self.watched_files():
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 304, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 120, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\kylec\.virtualenvs\Django_projects-1wiE7bc9\lib\site-packages\django\utils\autoreload.py", line 160, in iter_modules_and_files
if not path.exists():
File "c:\users\kylec\appdata\local\programs\python\python39\lib\pathlib.py", line 1407, in exists
self.stat()
File "c:\users\kylec\appdata\local\programs\python\python39\lib\pathlib.py", line 1221, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
(Django_projects) PS C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify>
* History restored
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954, in _bootstrap_inner
self.run()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\config.py", line 193, in create
import_module(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\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 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'account'
Traceback (most recent call last):
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 22, in <module>
main()
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 74, in execute
super().execute(*args, **options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\base.py", line 448, in execute
output = self.handle(*args, **options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 111, in handle
self.run(**options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\commands\runserver.py", line 118, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 680, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 661, in start_django
reloader.run(django_main_thread)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 344, in run
self.run_loop()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 350, in run_loop
next(ticker)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 390, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 411, in snapshot_files
for file in self.watched_files():
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 304, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 120, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\utils\autoreload.py", line 160, in iter_modules_and_files
if not path.exists():
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1407, in exists
self.stat()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1221, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Thinking that since I deleted "account" I need to revert all the migrations I went to the terminal and tried this:
py manage.py migrate account zero
The following is the error that I got:
Traceback (most recent call last):
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 22, in <module>
main()
File "C:\Users\kylec\OneDrive\Documents\school_files\team_project\Django\bookify\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\management\__init__.py", line 420, in execute
django.setup()
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\site-packages\django\apps\config.py", line 193, in create
import_module(entry)
File "C:\Users\kylec\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'account'
I restored the file and then opened every folder (urls, views, etc) and deleted everything in the files. I did py manage.py makemigrations account and then py manage.py squashmigrations account
-everything is up and running again
I am currently setting up a simple search in django using the elastic search and haystack packages.
However, when I run the server , it occures the following error:
(development_env) C:\Users\user\Desktop\Development\development>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'elasticsearch-dsl'
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 598, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 583, in start_django
reloader.run(django_main_thread)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 301, in run
self.run_loop()
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 307, in run_loop
next(ticker)
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 347, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 363, in snapshot_files
for file in self.watched_files():
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 262, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\user\Desktop\Development\development\development_env\lib\site-packages\django\utils\autoreload.py", line 139, in iter_modules_and_files
if not path.exists():
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1385, in exists
self.stat()
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1191, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
I particularly wondering about the error: ModuleNotFoundError: No module named 'elasticsearch-dsl'.
If I check my installed packages, I see that 'elasticsearch-dsl' is installed:
(development_env) C:\Users\user\Desktop\Development\development>pip list
Package Version
------------------------ -------
appdirs 1.4.3
asgiref 3.2.3
distlib 0.3.0
Django 2.2.10
django-crispy-forms 1.8.1
django-elasticsearch-dsl 7.1.1
django-haystack 2.8.1
django-six 1.0.4
elasticsearch 7.5.1
elasticsearch-dsl 7.1.0
filelock 3.0.12
Pillow 7.0.0
pip 19.2.3
python-dateutil 2.8.1
pytz 2019.3
setuptools 41.2.0
six 1.14.0
sqlparse 0.3.0
urllib3 1.25.8
virtualenv 20.0.5
virtualenvwrapper-win 1.2.6
I also checked 'django-elasticsearch-dsl' instead of 'elasticsearch-dsl' but the error code is the same. I seems that the elastic search package is somehow not correctly installed in my virutal environment.
I'm thankful for every hint.
Greetings Daniel
You have to add the package inside of your app/settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
....
'elasticsearch-dsl'
]
The error should disappear.
Greetings Alex
**Don't know what the problem is. I am not able to run any of my Django servers.
Every time gets the same error.
And don't have any idea about this.
Tried reinstalling windows, python and all. But still gets same error.
**
Don't know what the problem is. I am not able to run any of my Django servers.
Every time gets the same error.
And don't have any idea about this.
Tried reinstalling windows, python and all. But still gets same error.
C:\Users\JamesBond\Desktop\ONLINE WEBSITES\vishwatradelink_>manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in 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 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'crispy_forms'
Traceback (most recent call last):
File "C:\Users\JamesBond\Desktop\ONLINE WEBSITES\vishwatradelink_\manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 598, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 583, in start_django
reloader.run(django_main_thread)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 301, in run
self.run_loop()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 307, in run_loop
next(ticker)
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 347, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 363, in snapshot_files
for file in self.watched_files():
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 262, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py", line 139, in iter_modules_and_files
if not path.exists():
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\pathlib.py", line 1346, in exists
self.stat()
File "C:\Users\JamesBond\AppData\Local\Programs\Python\Python37-32\lib\pathlib.py", line 1168, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'**
Run the following commands:
(write python according to your OS this commands below are for windows)
1) python manage.py makemigrations
and then
2) python manage.py migrate
Mostly, this will make your command
python manage.py runserver work!
From the error message that you are getting check there is a line:
ModuleNotFoundError: No module named 'crispy_forms'
This means in your settings.py file you have 'crispy_forms' among the installed apps but this time its not included in your python environment. To resolve this you have to install crispy_forms using
pip install django-crispy-forms
For more on django-crispy-forms see the documentation https://django-crispy-forms.readthedocs.io/en/latest/install.html
**No module named 'crispy_forms'
this is the problem
OR
command is python manage.py runserver, not manage.py runserver
In my case I have added the name of my app before creating that app in the settings.py file of the main project. Kindly add the name of your app in settings.py file after creating the app. That's why you are not able to run the server
If you have this problem, go to the settings.py file, and check for comas, and if rest_framework is correctly spelled.
Make sure to be in the right virtual environment you previously worked on because everything you previously installed like rest_framework, django will be stored in that environment, and try running the command.
python manage.py runserver
I am using windows 10 python 3.7.3 and django 2.7.2 ,I am new to Django. Want to reuse the movie app "https://github.com/nathanborror/django-basic-apps/tree/master/basic " in my project.
Steps done before running the manage.py runserver:
1) Copied the folder in my django project directory
2) Have added the app in the Installed apps in Settings.py
3) Have updated the apps url in the urls.py file of my main django project
4) Have checked from the git repo page , no additional dependancy to be downloaded.
Error after running manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[0](_exception[1]).with_traceback(_exception[2])
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\config.py", line 116, in create
mod = import_module(mod_path)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in 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 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pollsdjango-basic-apps-master'
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 577, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 562, in start_django
reloader.run(django_main_thread)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 280, in run
self.run_loop()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 286, in run_loop
next(ticker)
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 326, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 342, in snapshot_files
for file in self.watched_files():
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 241, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 128, in iter_modules_and_files
if not path.exists():
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\pathlib.py", line 1339, in exists
self.stat()
File "C:\Users\dhaval1.desai\AppData\Local\Programs\Python\Python37\lib\pathlib.py", line 1161, in stat
return self._accessor.stat(self)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Help will be very much appreciated.
I downloaded python 3.7 and django framework.
There is an existing project I want to run and execute. I've added python interpreter, there wasn't any errors and then I tried to run it and... as ypu can see there are a lot of errors. I don't know the reason and a way to solve that problem
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Python\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Python\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 77, in raise_last_exception
raise _exception[0](_exception[1]).with_traceback(_exception[2])
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "C:\Python\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Python\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'social_django'
Traceback (most recent call last):
File "C:/Users/skantorp/Documents/Univer/Task02/SSPLS/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Python\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Python\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Python\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Python\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 577, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 562, in start_django
reloader.run(django_main_thread)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 280, in run
self.run_loop()
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 286, in run_loop
next(ticker)
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 326, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 342, in snapshot_files
for file in self.watched_files():
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 241, in watched_files
yield from iter_all_python_module_files()
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "C:\Python\lib\site-packages\django\utils\autoreload.py", line 128, in iter_modules_and_files
if not path.exists():
File "C:\Python\lib\pathlib.py", line 1319, in exists
self.stat()
File "C:\Python\lib\pathlib.py", line 1139, in stat
return self._accessor.stat(self)
File "C:\Python\lib\pathlib.py", line 390, in wrapped
return strfunc(str(pathobj), *args)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Process finished with exit code 1
Does anyone have any ideas? If you do please let me know. Any help appreciates