This project is archived and is in readonly mode.
Reason: image not found
Reported by Joshua Kehn | October 13th, 2013 @ 07:18 PM
I'm having an issue with psycopg2. This issue never presented under 2.4.5 until I tried to install 2.5. After noticing the issue I uninstalled (pip) and re-installed the old version. The issue then persisted. I then manually copied the old version out of another project's virtual environment to resolve the issue. Here is a traceback I get when using SQLAlchemy:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-e64bc0575b72> in <module>()
----> 1 e = get_engine()
/Users/josh/Dropbox/Projects/sqla/models.pyc in get_engine()
9 global engine
10 if not engine:
---> 11 engine = create_engine("postgres://localhost/leadgen", echo=True)
12 return engine
13
/Users/josh/Dropbox/Projects/sqla/venv/lib/python2.7/site-packages/sqlalchemy/engine/__init__.pyc in create_engine(*args, **kwargs)
330 strategy = kwargs.pop('strategy', default_strategy)
331 strategy = strategies.strategies[strategy]
--> 332 return strategy.create(*args, **kwargs)
333
334
/Users/josh/Dropbox/Projects/sqla/venv/lib/python2.7/site-packages/sqlalchemy/engine/strategies.pyc in create(self, name_or_url, **kwargs)
62 if k in kwargs:
63 dbapi_args[k] = kwargs.pop(k)
---> 64 dbapi = dialect_cls.dbapi(**dbapi_args)
65
66 dialect_args['dbapi'] = dbapi
/Users/josh/Dropbox/Projects/sqla/venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.pyc in dbapi(cls)
366 @classmethod
367 def dbapi(cls):
--> 368 import psycopg2
369 return psycopg2
370
/Users/josh/Dropbox/Projects/sqla/venv/lib/python2.7/site-packages/psycopg2/__init__.py in <module>()
65 # Import the DBAPI-2.0 stuff into top-level module.
66
---> 67 from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
68
69 from psycopg2._psycopg import Binary, Date, Time, Timestamp
ImportError: dlopen(/Users/josh/Dropbox/Projects/sqla/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: @loader_path/../lib/libssl.1.0.0.dylib
Referenced from: /Users/josh/Dropbox/Projects/sqla/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so
Reason: image not found
Here is a traceback from a Django app as well. Here the final cause is incorrect because if I replace the database backend the main issue "Reason: image not found" persists.
---------------------------------------------------------------------------
ImproperlyConfigured Traceback (most recent call last)
/Projects/webapp/venv/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
176 else:
177 filename = fname
--> 178 __builtin__.execfile(filename, *where)
/Projects/webapp/manage.py in <module>()
8 from django.core.management import execute_from_command_line
9
---> 10 execute_from_command_line(sys.argv)
/Projects/webapp/venv/lib/python2.7/site-packages/django/core/management/__init__.pyc in execute_from_command_line(argv)
441 """
442 utility = ManagementUtility(argv)
--> 443 utility.execute()
444
445 def execute_manager(settings_mod, argv=None):
/Projects/webapp/venv/lib/python2.7/site-packages/django/core/management/__init__.pyc in execute(self)
380 sys.stdout.write(self.main_help_text() + '\n')
381 else:
--> 382 self.fetch_command(subcommand).run_from_argv(self.argv)
383
384 def setup_environ(settings_mod, original_settings_path=None):
/Projects/webapp/venv/lib/python2.7/site-packages/django/core/management/base.pyc in run_from_argv(self, argv)
194 options, args = parser.parse_args(argv[2:])
195 handle_default_options(options)
--> 196 self.execute(*args, **options.__dict__)
197
198 def execute(self, *args, **options):
/Projects/webapp/venv/lib/python2.7/site-packages/django/core/management/base.pyc in execute(self, *args, **options)
230 if self.requires_model_validation:
231 self.validate()
--> 232 output = self.handle(*args, **options)
233 if output:
234 if self.output_transaction:
/Projects/webapp/venv/lib/python2.7/site-packages/django/core/management/base.pyc in handle(self, *args, **options)
369 if args:
370 raise CommandError("Command doesn't accept any arguments")
--> 371 return self.handle_noargs(**options)
372
373 def handle_noargs(self, **options):
/Projects/webapp/venv/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in handle_noargs(self, **options)
43 # XXX: (Temporary) workaround for ticket [#1796](/projects/62710/tickets/1796 "Ticket #1796"): force early loading of all
44 # models from installed apps.
---> 45 from django.db.models.loading import get_models
46 get_models()
47
/Projects/webapp/venv/lib/python2.7/site-packages/django/db/__init__.py in <module>()
38
39 connection = DefaultConnectionProxy()
---> 40 backend = load_backend(connection.settings_dict['ENGINE'])
41
42 # Register an event that closes the database connection
/Projects/webapp/venv/lib/python2.7/site-packages/django/db/__init__.py in __getattr__(self, item)
32 """
33 def __getattr__(self, item):
---> 34 return getattr(connections[DEFAULT_DB_ALIAS], item)
35
36 def __setattr__(self, name, value):
/Projects/webapp/venv/lib/python2.7/site-packages/django/db/utils.pyc in __getitem__(self, alias)
90 self.ensure_defaults(alias)
91 db = self.databases[alias]
---> 92 backend = load_backend(db['ENGINE'])
93 conn = backend.DatabaseWrapper(db, alias)
94 setattr(self._connections, alias, conn)
/Projects/webapp/venv/lib/python2.7/site-packages/django/db/utils.pyc in load_backend(backend_name)
42 "is one of:\n %s\nError was: %s" %
43 (backend_name, ", ".join(backend_reprs), e_user))
---> 44 raise ImproperlyConfigured(error_msg)
45 elif not full_notation:
46 # user tried to use the old notation for the database backend
ImproperlyConfigured: 'django_postgrespool' isn't an available database backend.
Try using django.db.backends.XXX, where XXX is one of:
'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: dlopen(/Projects/webapp/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: @loader_path/../lib/libssl.1.0.0.dylib
Referenced from: /Projects/webapp/venv/lib/python2.7/site-packages/psycopg2/_psycopg.so
Reason: image not found
Was there some change in 2.4.5 that was pushed under the same
version number? I'm using Postgres.app (http://postgresapp.com) on my system
and haven't seen this issue before. pip install
resolves cleanly, this issue only comes up when I try to connect to
the database.
Comments and changes to this ticket
-
Joshua Kehn October 13th, 2013 @ 10:18 PM
Looks like this is a duplicate of http://psycopg.lighthouseapp.com/projects/62710/tickets/111-library...
-
Daniele Varrazzo October 14th, 2013 @ 10:55 AM
- State changed from new to invalid
Most definitely it is some library mix-up on your box.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.