Closed ejdenh closed 7 years ago
@ejdenh do you have an app called rest_frameworkcompanies
? Perhaps there's a missing comma after rest_framework
.
Thanks for replay I am quite new with Python and django. But the strange thing is that. If i add apps in settings file there is no autofill so a have two type everthing in INSTALLED APPS.
So a have no module named 'rest_frameworkcompanies'
I follow this https://youtu.be/Yw7gETuRKjw?list=PL6gx4Cwl9DGBlmzzFcLgDhKTTfNLfX1IK&t=236 (see autofill in youtube fill)
INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework' 'companies.apps.CompaniesConfig' ]
Thanks
How did you solve this?
[
...
'rest_framework'
'companies.apps.CompaniesConfig'
]
causes the strings to be joined into one, "'rest_frameworkcompanies.apps.CompaniesConfig". There's a missing comma, as Jose Padilla suggested.
i think you missed to put comma in each additional apps corrected is : 'rest_framework', 'companies.apps.CompaniesConfig',
For a third party package, you may have to install it globally on your system even after adding to your virtual env. compX:/#pip install packagename
As pointed out by @jpadilla, Don't forget the trailing comma (,). solved mine. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'companies.apps.CompaniesConfig', ]
Traceback (most recent call last):
File "manage.py", line 21, in
what's the problem is that .i don't understand it.
Are you working in a virtual env? If so, ensure you active the environment and have django-CORS-headers installed before running command
same problem with me but the solutio is not working for me. i dont have a missing comma
@abdo907 Are you working in a virtual env? If so, ensure you activated the environment and have django-CORS-headers installed in the environment before running the command
(project1_env) C:\Users\HI\Desktop\django_project>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\HI\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\HI\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, self._kwargs)
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, *kwargs)
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\core\management__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(args, kwargs)
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django__init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\HI\Environments\project1_env\lib\site-packages\django\apps\config.py", line 116, in create
mod = import_module(mod_path)
File "C:\Users\HI\AppData\Local\Programs\Python\Python38-32\lib\importlib__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
can someone help me out?
ok solved
ved
hey! how did u solve it?
how to solve
how?
Guys, I found solution. You make sure, that name yours app in SETTINGS.py INSTALLED_APPS typed correct.
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '
Please solve this error
This is similar to something that happened to me.
After checking the traceback message I've noticed the following:
File...
ModuleNotFoundError: No module named '<app_name>'
File...
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
In my specific case I have misspelled the name of the app in settings.py/INSTALLED_APPS
, that's why the ModuleNotFoundError
.
Django was looking for <app_name>.apps.<app_name>Config
(for instance: blog.apps.BlogConfig
), but I had a typo (like this one: blogg.apps.BlogConfig
) and Django raised an error.
Here is a link to my answer in Stackoverflow.
[Version 6.2.9200] (c) 2012 Microsoft Corporation. All rights reserved.
(myvenv) C:\Users\hind\Desktop\department>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\hind\anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\hind\anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, self._kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, *kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(args, kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django__init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\hind\anaconda3\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
(myvenv) C:\Users\hind\Desktop\department>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\hind\anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\hind\anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, self._kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, *kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(args, kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django__init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\hind\anaconda3\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
(myvenv) C:\Users\hind\Desktop\department>python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 21, in
(myvenv) C:\Users\hind\Desktop\department>python manage.py makemigrations
Traceback (most recent call last):
File "manage.py", line 21, in
(myvenv) C:\Users\hind\Desktop\department>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\hind\anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\hind\anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, self._kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, *kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(args, kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django__init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\hind\anaconda3\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
(myvenv) C:\Users\hind\Desktop\department>cls
(myvenv) C:\Users\hind\Desktop\department>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\hind\anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\hind\anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, self._kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, *kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run
autoreload.raise_last_exception()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\core\management__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(args, kwargs)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django__init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\hind\Desktop\department\myvenv\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\hind\anaconda3\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
plz solve error
In my App named loginaccounts I named the folder url.py instead of urls.py Where as in settings.py I wrote path('', include('loginaccounts.urls')) So the name you write in settting.py is appname.urls this urls is basically the folder name you mention in app which is urls.py. They should match.
Traceback (most recent call last):
File "f:/My First Project/lambogini/lambogini/urls.py", line 21, in
i am getting this error
hello good people How do I handle the below exception:
ModuleNotFoundError at /accounts/signup/
No module named 'users.forms'
What's wrong? can someone help me?
In the settings.py (INSTALLED_APPS) I'm unable to add apps.!! {{{ C:\Users\Administrator\PycharmProjects\website>python manage.py makemigrations Traceback (most recent call last): File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management__init.py", line 337, in execute
django.setup()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\init.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\apps\config.py", line 120, in create
mod = import_module(mod_path)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\importlib\init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 936, in _find_and_load_unlocked
File "", line 205, in _call_with_frames_removed
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_frameworkcompanies'
}}}