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

django.db.utils.OperationalError: no such table: layer_classification_classificationmethod #121

Open
didaRo opened this issue Feb 15, 2017 · 14 comments

Comments

@didaRo
Copy link

didaRo commented Feb 15, 2017

Hello
I tried to connect Dataverse with Worldmap, using connector geoconnect
I followed step by step instructions, but i had the following error at the "Create/sync the database (still in ~\geoconnect)" step, at python manage.py migrate instruction :
django.db.utils.OperationalError: no such table: layer_classification_classificationmethod
Can someone please help me to resolve this problem ?
Thanks!!!

@raprasad
Copy link
Collaborator

@didaRo : Should have usable instructions soon.

  • Try this line: python manage.py migrate --run-syncdb
  • Feel free to contact me directly via [email protected]

@verma1997
Copy link

Hello
First, I've tried
python manage.py makemigrations app_name
Then,
python manage.py migrate
and This is showing in my console
**Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "C:\Users\PRIYANSHU-IIITV\Miniconda3\envs\myDjangoEnv\lib\site-packages\django\core\management_init_.py", line 371, in execute_from_command_line

utility.execute()

File "C:\Users\PRIYANSHU-IIITV\Miniconda3\envs\myDjangoEnv\lib\site-packages\django\core\management_init_.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\PRIYANSHU-IIITV\Miniconda3\envs\myDjangoEnv\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\PRIYANSHU-IIITV\Miniconda3\envs\myDjangoEnv\lib\site-packages\django\core\management\base.py", line 335, in execute
output = self.handle(*args, options)
File "C:\Users\PRIYANSHU-IIITV\Miniconda3\envs\myDjangoEnv\lib\site-packages\django\core\management\commands\migrate.py", line 82, in handle
executor.loader.check_consistent_history(connection)
File "C:\Users\PRIYANSHU-IIITV\Miniconda3\envs\myDjangoEnv\lib\site-packages\django\db\migrations\loader.py", line 291, in check_consistent_history
connection.alias,
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency WebApp.0001_initial on database 'default'.

And the error coming is
OperationalError : no such table: WebApp_user

Please help me

@pdurbin
Copy link
Member

pdurbin commented Oct 2, 2018

@verma1997 hi, I doubt Geoconnect can be installed on Windows but I don't think this issue tracker is watched especially closely and you should probably email [email protected] or post at https://groups.google.com/forum/#!forum/dataverse-community

@vishvapatel
Copy link

MY app name is 'music'. and i am trying to add it to the app but no clue I have also added the 'music.apps.MusicConfig' app attachment to my django_demo\settings.py\INSTALLED_APPS[],
but still error. and i am getting error on 'python manage.py makemigrations music' command also.
please help!
I am getting this error after applying @raprasad code. please i have searched for three days and still no clue.
I have tried everything that i found, stackoverflow also recommends the --run-syncdb command but still error.
THE ERROR IS :

C:\Users\vishva\Desktop\Django>python manage.py migrate --run-syncdb
Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "C:\Users\vishva\AppData\Local\Programs\Python\Python37\lib\site-packages\django-2.1.3-py3.7.egg\django\core\management_init_.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\vishva\AppData\Local\Programs\Python\Python37\lib\site-packages\django-2.1.3-py3.7.egg\django\core\management_init_.py", line 357, in execute
django.setup()
File "C:\Users\vishva\AppData\Local\Programs\Python\Python37\lib\site-packages\django-2.1.3-py3.7.egg\django_init_.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\vishva\AppData\Local\Programs\Python\Python37\lib\site-packages\django-2.1.3-py3.7.egg\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\vishva\AppData\Local\Programs\Python\Python37\lib\site-packages\django-2.1.3-py3.7.egg\django\apps\config.py", line 116, in create
mod = import_module(mod_path)
File "C:\Users\vishva\AppData\Local\Programs\Python\Python37\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 953, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 962, in _find_and_load_unlocked
**ModuleNotFoundError: No module named 'music.apps.MusicConfigdjango'; 'music.apps' is not a package**

@pdurbin
Copy link
Member

pdurbin commented Nov 20, 2018

@vishvapatel good luck with your music app but it seems to have nothing to do with Geoconnect.

@bvsp2109
Copy link

Hello i'm trying to create multi Users in Django
but no of error i faced but this error is to difficult try to solve this error also but this not solved
Error:(
E:\dual prj\Python_Project>py manage.py migrate
Operations to perform:
Apply all migrations: Python_App, admin, auth, contenttypes, guardian, polls, sessions
Running migrations:
No migrations to apply.
Traceback (most recent call last):
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\sqlite3\base.py", line 296, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: Python_App_user

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "C:\Users\PRATAP BILLU\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\PRATAP BILLU\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\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 353, in execute
output = self.handle(*args, **options)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\migrate.py", line 226, in handle
self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\sql.py", line 51, in emit_post_migrate_signal
**kwargs
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\dispatch\dispatcher.py", line 175, in send
for receiver in self._live_receivers(sender)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\dispatch\dispatcher.py", line 175, in
for receiver in self.live_receivers(sender)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\guardian\management_init
.py", line 31, in create_anonymous_user
User.objects.using(kwargs['using']).get(**lookup)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py", line 393, in get
num = len(clone)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py", line 250, in len
self._fetch_all()
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py", line 1186, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\query.py", line 54, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\models\sql\compiler.py", line 1065, in execute_sql
cursor.execute(sql, params)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py", line 100, in execute
return super().execute(sql, params)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "C:\Users\PRATAP BILLU\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\sqlite3\base.py", line 296, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: Python_App_user
)

@mnsrknp
Copy link

mnsrknp commented Dec 4, 2019

Change "django.contrib.admin" in INSTALLED_APPS to "django.contrib.admin.apps.SimpleAdminConfig" and then run makemigrations command. after that you can revert your changes.

@adilmarghadi
Copy link

@didaRo : Should have usable instructions soon.

  • Try this line: python manage.py migrate --run-syncdb
  • Feel free to contact me directly via [email protected]

Thank You So Much

@raprasad
Copy link
Collaborator

@adilmarghadi : For geoconnect questions, I would check with the Dataverse team: https://dataverse.org/contact.
(My involvement with the code ended ~ 3 years ago)

@raychowdhury
Copy link

Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/Users/jokeralvi/Desktop/wisdompets/adoptions/management/commands/load_pet_data.py", line 34, in handle
if Vaccine.objects.exists() or Pet.objects.exists():
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/models/query.py", line 673, in exists
return self.query.has_results(using=self.db)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/models/sql/query.py", line 517, in has_results
return compiler.has_results()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 858, in has_results
return bool(self.execute_sql(SINGLE))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
raise original_exception
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
cursor.execute(sql, params)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/utils.py", line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 328, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: adoptions_vaccine

It will be helpful if anyone point me right direction.Where I should add the table of "adoptions_vaccine"?

@ShivamRohilllaa
Copy link

@didaRo : Should have usable instructions soon.

  • Try this line: python manage.py migrate --run-syncdb
  • Feel free to contact me directly via [email protected]

Thank you broo its working

@MarkSCQ
Copy link

MarkSCQ commented Dec 4, 2020

@didaRo : Should have usable instructions soon.

  • Try this line: python manage.py migrate --run-syncdb
  • Feel free to contact me directly via [email protected]

It works!!!!! Thank you so much!!!

@pdurbin
Copy link
Member

pdurbin commented Dec 4, 2020

Geoconnect and Worldmap are being removed from Dataverse. Please see "Remove Worldmap/Geoconnect from Application" at IQSS/dataverse#7409

@Emad-Eldin-G
Copy link

Try:
python manage.py makemigrations <app name>
python manage.py migrate <app name>

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