I'm getting this error
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
self.execute(*args, **cmd_options)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 440, in execute
self.check()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 478, in check
include_deployment_checks=include_deployment_checks,
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py", line 1183, in check
errors.extend(cls._check_long_column_names())
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py", line 1588, in _check_long_column_names
connection = connections[db]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 240, in __getitem__
backend = load_backend(db['ENGINE'])
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 111, in load_backend
return import_module('%s.base' % backend_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 24, in <module>
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Expected in: /Library/PostgreSQL/9.4/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Can you please tell me where I am going wrong?
BTW, my psycopg2 is working fine as a standalone module.
this statement solved everything: export DYLD_LIBRARY_PATH=''
You have to be more precisely with your Question.
First of all, your error is :
ImproperlyConfigured: Error loading psycopg2 module
When do you get this error? (what command you run?)
What is your settings.py looking like?
Also you should format your Question better, it's a pain to read this Traceback!
I know this is more a comment then an answer, but i don't had enough reputation for that.
Related
I deleted some migration files that were giving me the error.
Then when I write "python3 manage.py showmigrations" I get the following error:
root#chat-manager:/var/www/jinabot# python3 manage.py makemigrations
Traceback (most recent call last):
File "manage.py", line 23, in <module>
main()
File "manage.py", line 19, in main
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 419, in exe
utility.execute()
File "/usr/local/lib/python3.7/dist-packages/django/core/management/__init__.py", line 413, in exe
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 354, in run_fro
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/base.py", line 89, in wrapped
res = handle_func(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/django/core/management/commands/makemigrations.py", l
loader = MigrationLoader(None, ignore_no_migrations=True)
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/loader.py", line 53, in __init__
self.build_graph()
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/loader.py", line 259, in build_g
self.graph.validate_consistency()
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/graph.py", line 195, in validate
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/graph.py", line 195, in <listcom
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/usr/local/lib/python3.7/dist-packages/django/db/migrations/graph.py", line 58, in raise_err
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration app.0172_auto_20220603_1746 dependencie
_auto_20220601_2313')
How to fix it?
If you have such an error at the development stage, then I don’t know if this is correct, but I would probably delete all the migrations of the conflicting application and the database too, and then run "python manage.py makemigrations"
(Sorry, comments are not available to me)
I'm attempting to upgrade Django from 1.10.7 to 1.11.4 with Python 2.7.11. I've run pip install Django -U and python -c "import django; print django.get_version()" confirms that Django 1.11.4 is installed. However, when I then go to run tests, I get ImportError: No module named notmigrations. Does anyone have any advice?
Here is the full stack trace:
Traceback (most recent call last):
File "./manage.py", line 25, in <module>
execute_from_command_line(sys.argv)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/commands/test.py", line 62, in handle
failures = test_runner.run_tests(test_labels)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/test/runner.py", line 601, in run_tests
old_config = self.setup_databases()
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/test/runner.py", line 546, in setup_databases
self.parallel, **kwargs
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/test/utils.py", line 187, in setup_databases
serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 69, in create_test_db
run_syncdb=True,
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/__init__.py", line 130, in call_command
return command.execute(*args, **defaults)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 83, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/db/migrations/loader.py", line 52, in __init__
self.build_graph()
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/db/migrations/loader.py", line 203, in build_graph
self.load_disk()
File "/home/vagrant/.virtualenvs/rhw/lib/python2.7/site-packages/django/db/migrations/loader.py", line 82, in load_disk
module = import_module(module_name)
File "/usr/local/lib/python2.7.11/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named notmigrations
It looks like you are using notmigrations in your MIGRATION_MODULES setting to disable migrations (as described in this post).
In Django 1.9+, you should simply use None instead of a fake module name like 'notmigrations' (release notes).
For Django 2.0 I create setting file as described here with content like:
from settings import *
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return None
MIGRATION_MODULES = DisableMigrations()
and run my tests with test newly created setting
I have a local python environment working, but when I try and load in initial data.
python manage.py loaddata initial_data.json
I get an error about "RemovedInDjango18Warning"?
I am not a python dev to say - so this error is new to me.
C:\Python27\aasoo>python manage.py loaddata initial_data.json
C:\Python27\lib\site-packages\djorm_pgfulltext\models.py:323: RemovedInDjango18Warning: `SearchManagerMixIn.get_query_set` method should be renamed `get_queryset`.
class SearchManager(SearchManagerMixIn, models.Manager):
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 385, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 338, in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\modeltranslation\management\commands\loaddata.py", line 50, in handle
return super(Command, self).handle(*fixture_labels, **options)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.py", line 61, in handle
self.loaddata(fixture_labels)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.py", line 91, in loaddata
self.load_label(fixture_label)
File "C:\Python27\lib\site-packages\django\core\management\commands\loaddata.py", line 142, in load_label
for obj in objects:
File "C:\Python27\lib\site-packages\django\core\serializers\json.py", line 81, in Deserializer
six.reraise(DeserializationError, DeserializationError(e), sys.exc_info()[2])
File "C:\Python27\lib\site-packages\django\core\serializers\json.py", line 75, in Deserializer
for obj in PythonDeserializer(objects, **options):
File "C:\Python27\lib\site-packages\django\core\serializers\python.py", line 122, in Deserializer
m2m_data[field.name] = [m2m_convert(pk) for pk in field_value]
django.core.serializers.base.DeserializationError: Problem installing fixture 'C:\Python27\aasoo\content\fixtures\initial_data.json': 'int' object is not iterable
C:\Python27\aasoo>
You should rename get_query_set to get_queryset in SearchManagerMixIn. Can you paste the definition of the class if you need more help.
Sentry
I've been using this to setup the environment: Sentry Setup
But when I get to this command:
sentry --config=/etc/sentry.conf.py upgrade
It gives me this error:
nope#not_telling_you-ubuntu:~/scratch$ sudo sentry --config=/etc/sentry.conf.py upgrade
Traceback (most recent call last):
File "/usr/local/bin/sentry", line 9, in <module>
load_entry_point('sentry==5.4.5', 'console_scripts', 'sentry')()
File "/usr/local/lib/python2.7/dist-packages/sentry-5.4.5-py2.7.egg/sentry/utils/runner.py", line 197, in main
initializer=initialize_app,
File "/usr/local/lib/python2.7/dist-packages/logan/runner.py", line 162, in run_app
management.execute_from_command_line([runner_name, command] + command_args)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 252, in fetch_command
app_name = get_commands()[subcommand]
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 101, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 93, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/logan/importer.py", line 68, in load_module
return self._load_module(fullname)
File "/usr/local/lib/python2.7/dist-packages/logan/importer.py", line 92, in _load_module
load_settings(self.config_path, allow_extras=self.allow_extras, settings=settings_mod)
File "/usr/local/lib/python2.7/dist-packages/logan/settings.py", line 49, in load_settings
execfile(mod_or_filename, conf.__dict__)
File "/etc/sentry.conf.py", line 45, in <module>
dgin
django.core.exceptions.ImproperlyConfigured: NameError("name 'dgin' is not defined",)
asdas#asdas-ubuntu:~/scratch$
Any idea what could be going on? I've setup everything until this point.
"dgin" is an undefined variable in the sentry configuration
It's likely this is a mistype or something similar, but that's what the error means.
This was the traceback, please help.
Traceback (most recent call last):
File "C:\Documents and Settings\EC.32-SAMUEL\workspace\ec\ec\manage.py", line 11, in <module>
execute_manager(settings)
File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager
utility.execute()
File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 219, in execute
self.validate()
File "C:\Python26\lib\site-packages\django\core\management\base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "C:\Python26\lib\site-packages\django\core\management\validation.py", line 36, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 146, in get_app_errors
self._populate()
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 61, in _populate
self.load_app(app_name, True)
File "C:\Python26\lib\site-packages\django\db\models\loading.py", line 83, in load_app
if not module_has_submodule(app_module, 'models'):
File "C:\Python26\lib\site-packages\django\utils\module_loading.py", line 17, in module_has_submodule
for entry in package.__path__: # No __path__, then not a package.
AttributeError: 'module' object has no attribute '
path'
BeautifulSoup is not a Django-app. Its a python package/module. You don't have to add to INSTALLED_APPS. It just need to be available in your PYTHONPATH to use it.
Your traceback doesn't give clue what is actually wrong with your Django project.
The only time you ever need to do a syncdb is when you have to do something to the db. BeautifulSoup does not need to use the db at any point and does not need to be an installed app