python manage.py migrate: No module named 'muypicky.base' - python

Background: I'm taking a beginners Django course and I've run into an issue. The following command isn't working in Terminal.
Running on Mac
Virtual environment
Taking UDEMY Course: try-django-v1-11-python-web-development
Command: python manage.py migrate
Terminal Output:
(trydjango1-11) C02T74CKGTF1:src josh.frazier$ python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/josh.frazier/Dev/trydjango1-11/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/josh.frazier/Dev/trydjango1-11/lib/python3.6/site-packages/django/core/management/__init__.py", line 307, in execute
settings.INSTALLED_APPS
File "/Users/josh.frazier/Dev/trydjango1-11/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/Users/josh.frazier/Dev/trydjango1-11/lib/python3.6/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/Users/josh.frazier/Dev/trydjango1-11/lib/python3.6/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/Users/josh.frazier/Dev/trydjango1-11/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/josh.frazier/Dev/trydjango1-11/src/muypicky/__init__.py", line 1, in <module>
from .base import *
ModuleNotFoundError: No module named 'muypicky.base'

After going through your files, i found that you haven't imported local.py and production.py in your __init__.py add the following code to __init__.py file inside settings folder
from .base import *
from .production import *
try:
from .local import *
except:
pass

Related

No module named 'graphql.type' in Django

I am New in Django and GraphQL, following the the article,
I am using python 3.8 in virtual env and 3.10 in windows, but same error occurs on both side, also tried the this Question, i also heard that GraphQL generate queries, But dont know how to generate it, But this error occurs:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/talha/ve/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/talha/ve/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run autoreload.raise_last_exception()
File "/home/talha/ve/lib/python3.8/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/home/talha/ve/lib/python3.8/site-packages/django/core/management/__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "/home/talha/ve/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/home/talha/ve/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/talha/ve/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/home/talha/ve/lib/python3.8/site-packages/django/apps/config.py", line 193, in create
import_module(entry)
File "/usr/lib/python3.8/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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/talha/ve/lib/python3.8/site-packages/ariadne/__init__.py", line 1, in <module>
from .enums import (
File "/home/talha/ve/lib/python3.8/site-packages/ariadne/enums.py", line 17, in <module>
from graphql.type import GraphQLEnumType, GraphQLNamedType, GraphQLSchema
ModuleNotFoundError: No module named 'graphql.type'```
You can try these following ways,
One, you can find graphql directory in the project, on python path. renaming it will fix the issue.
And also you can try these commands,
pip install pip --upgrade
pip install setuptools --upgrade
pip install gql[all]
Hope this helps, if not please let know. Thanks

Django - After installing "Bootstrap4" with pip, got syntax error on settings.py

After installing "Bootstrap4" using pip, add tags in html files, and adding it in requirements.txt and settings.py, do migrate but it shows this:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\Mehrab\menv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\Mehrab\menv\lib\site-packages\django\core\management\__init__.py", line 345, in execute
settings.INSTALLED_APPS
File "C:\Users\Mehrab\menv\lib\site-packages\django\conf\__init__.py", line 83, in __getattr__
self._setup(name)
File "C:\Users\Mehrab\menv\lib\site-packages\django\conf\__init__.py", line 70, in _setup
self._wrapped = Settings(settings_module)
File "C:\Users\Mehrab\menv\lib\site-packages\django\conf\__init__.py", line 177, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1776.0_x64__qbz5n2kfra8p0\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 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 779, in exec_module
File "<frozen importlib._bootstrap_external>", line 916, in get_code
File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\~\socialize\settings.py", line 72
WSGI_APPLICATION = 'socialize.wsgi.application'
^
SyntaxError: invalid syntax
I didn't find any broblem in settings.py

Django --> python manage.py runserver

I had previous django project named 'bike_project'. And i had two settings module for development and production inside settings folder of bike_project.
During that project i had
set DJANGO_SETTINGS_MODULE = bike_project.settings.development in command prompt.
But now when i create new django project (seller bike), the project is created. But when i run python manage.py "command", I get following error.
D:\seller_bike>python manage.py runserver
Traceback (most recent call last):
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py", line 369, in execute
output = self.handle(*args, **options)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\commands\runserver.py", line 67, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py", line 76, in __getattr__
self._setup(name)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py", line 63, in _setup
self._wrapped = Settings(settings_module)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py", line 142, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
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 'bike_project'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\base.py", line 341, in run_from_argv
connections.close_all()
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\utils.py", line 225, in close_all
for alias in self:
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\utils.py", line 219, in __iter__
return iter(self.databases)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\utils\functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\db\utils.py", line 153, in databases
self._databases = settings.DATABASES
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py", line 76, in __getattr__
self._setup(name)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py", line 63, in _setup
self._wrapped = Settings(settings_module)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\conf\__init__.py", line 142, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Users\offic\AppData\Local\Programs\Python\Python38-32\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 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
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 'bike_project'

ModuleNotFoundError: No module named 'snowpenguin'

(venv) E:\Studia Materialy\Semestr 4\IO\l02-nr-6-cyber-mechanik-l02team- master>python manage.py makemigrations L02
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\keray\venv\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\keray\venv\lib\site-packages\django\core\management\__init__.py", line 357, in execute django.setup()
File "C:\Users\keray\venv\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\keray\venv\lib\site-packages\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\keray\venv\lib\site-packages\django\apps\config.py", line 116, in create
mod = import_module(mod_path)
File "E:\Programowanie\Python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'snowpenguin'
Can't run python manage.py runserver because of this problem, python 3.7, Django 2.0.7. I have tried many versions of python, and Django, I have also reinstalled bootstrap.
For me, I had to download django-recaptcha versions 2 & 3. Might be different for you though. Just follow #Lemayzeur's comment and look in your INSTALLED_APPS to find out what to download via pip.

Why am I getting this: ImportError django.contrib.auth: No module named 'pylibmc'

Attempting to deploy to a virtualenv on Ubuntu 13.10 VPS ... running Python 3.3.2 and I can't figure out how to resolve this.
I tried doing a "pip install pylibmc" but that just blew up (I think because pylibmc does not support Python 3), but I'm not really sure.
Anyhow, can someone explain why I'm getting this message and how I can resolve the issue given my setup?
UPDATE: Traceback as requested
Traceback (most recent call last):
File "test/manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/srv/www/test/venv/lib/python3.3/site-packages/Django-1.6.3-py3.3.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/srv/www/test/venv/lib/python3.3/site-packages/Django-1.6.3-py3.3.egg/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/srv/www/test/venv/lib/python3.3/site-packages/Django-1.6.3-py3.3.egg/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/srv/www/test/venv/lib/python3.3/site-packages/Django-1.6.3-py3.3.egg/django/core/management/__init__.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/srv/www/test/venv/lib/python3.3/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1512, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1022, in load_module
File "<frozen importlib._bootstrap>", line 1003, in load_module
File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 868, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/srv/www/test/venv/lib/python3.3/site-packages/south/management/commands/__init__.py", line 10, in <module>
import django.template.loaders.app_directories
File "/srv/www/test/venv/lib/python3.3/site-packages/Django-1.6.3-py3.3.egg/django/template/loaders/app_directories.py", line 25, in <module>
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError django.contrib.auth: No module named 'pylibmc'

Categories

Resources