[Mailman-Developers] help with ImportError: No module named 'psycopg2'

Abhilash Raj raj.abhilash1 at gmail.com
Wed May 27 21:57:58 CEST 2015


On Wed, 27 May 2015 21:44:51 +0300
Danil Smirnov <danil at smirnov.la> wrote:

> I'm still trying to get Mailman 3 ready for the production.
> 
> I've set parameters for the production and trying to make post-update:
> 
> ---
> 
> (venv)[root at host mailman-bundler]# bin/mailman-post-update
> + '[' False == False ']'
> + mkdir -p /var/spool/mailman-web/static
> + /usr/local/src/mailman-bundler/bin/mailman-web-django-admin
> collectstatic --clear --noinput --verbosity 0
> + /usr/local/src/mailman-bundler/bin/mailman-web-django-admin compress
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_address_activation.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_address_activation_link.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_settings.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/mass_removal.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/archival_options.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/unsubscribe.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/login.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/subscription_requests.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_subscriptions.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_tasks.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/confirm_delete.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/summary.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/settings.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_mailmansettings.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/members.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/mass_subscribe.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/domain_index.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/metrics.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_profile.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/subscriptions.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/settings_legacy.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_subscription_preferences.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/memberoptions.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/held_messages.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_address_activation_sent.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/index.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/user_address_preferences.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/confirm_dialog.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/domain_confirm_delete.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/site_settings.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/subscribe.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/errors/generic.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/domain_new.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Error parsing template
> /usr/local/src/mailman-bundler/eggs/postorius-1.0.1-py2.7.egg/postorius/templates/postorius/lists/new.html:
> Invalid template name in 'extends' tag: ''. Got this from the
> 'postorius_base_template' variable.
> Found 'compress' tags in:
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/user_posts.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/message_new.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/api.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/reattach.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/user_profile.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/login.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/message.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/index.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/register.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/errors/schemaupgrade.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/404.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/overview.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/thread_list.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/500.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/errors/private.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/base.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/search_results.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/thread.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/user_public_profile.html
>     /usr/local/src/mailman-bundler/eggs/HyperKitty-1.0.1-py2.7.egg/hyperkitty/templates/hyperkitty/errors/notimplemented.html
> Compressing... done
> Compressed 3 block(s) from 20 template(s).
> +++ /usr/local/src/mailman-bundler/bin/django-read-settings
> DATABASES.default.NAME
> ++ dirname mailman3
> + dbdir=.
> + mkdir -p .
> +
> syncdb_cmd='/usr/local/src/mailman-bundler/bin/mailman-web-django-admin
> migrate'
> + [[ ! -t 1 ]]
> + /usr/local/src/mailman-bundler/bin/mailman-web-django-admin migrate
> Operations to perform:
>   Synchronize unmigrated apps: postorius, compressor,
> django_extensions, paintstore, django_gravatar, rest_framework,
> haystack, crispy_forms
>   Apply all migrations: sessions, admin, auth, default, contenttypes,
> hyperkitty Synchronizing apps without migrations:
>   Creating tables...
>   Installing custom SQL...
>   Installing indexes...
> Running migrations:
>   No migrations to apply.
>   Your models have changes that are not yet reflected in a migration,
> and so won't be applied.
>   Run 'manage.py makemigrations' to make new migrations, and then
> re-run 'manage.py migrate' to apply them.
> + /usr/local/src/mailman-bundler/bin/mailman-web-django-admin
> update_index Indexing 0 emails
> + '[' '!' -f /usr/sbin/postmap ']'
> + /usr/local/src/mailman-bundler/bin/mailman aliases
> Traceback (most recent call last):
>   File "/usr/local/src/mailman-bundler/venv-3.4/bin/mailman", line 9,
> in <module>
>     load_entry_point('mailman==3.0.0', 'console_scripts', 'mailman')()
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/mailman/bin/mailman.py",
> line 98, in main initialize(config_path)
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/mailman/core/initialize.py",
> line 191, in initialize initialize_2(propagate_logs=propagate_logs)
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/mailman/core/initialize.py",
> line 163, in initialize_2 config.db = getUtility(IDatabaseFactory,
> utility_name).create() File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/mailman/database/factory.py",
> line 59, in create database.initialize()
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/mailman/database/base.py",
> line 110, in initialize self.engine = create_engine(url)
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/sqlalchemy/engine/__init__.py",
> line 386, in create_engine return strategy.create(*args, **kwargs)
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/sqlalchemy/engine/strategies.py",
> line 75, in create dbapi = dialect_cls.dbapi(**dbapi_args)
>   File
> "/usr/local/src/mailman-bundler/venv-3.4/lib/python3.4/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py",
> line 554, in dbapi import psycopg2
> ImportError: No module named 'psycopg2'
> 
> ---
> 
> But:
> 
> pip install psycopg2
> You are using pip version 6.1.1, however version 7.0.1 is available.
> You should consider upgrading via the 'pip install --upgrade pip'
> command. Requirement already satisfied (use --upgrade to upgrade):
> psycopg2 in /usr/local/src/venv/lib/python2.7/site-packages

There are actually 2 virtualenvs for mailman. One is the default one
that you are working in, another one(venv-3.4) is probably automatically
created by mailman-bundler as you can see in the logs above.
This should fix your problem.

  $ source /usr/local/src/mailman-bundler/venv-3.4/bin/activate
  $ pip install psycopg2
  $ (reactivate your original venv)

> 
> 
> Please advice.
> 
> Danil
> _______________________________________________
> Mailman-Developers mailing list
> Mailman-Developers at python.org
> https://mail.python.org/mailman/listinfo/mailman-developers
> Mailman FAQ: http://wiki.list.org/x/AgA3
> Searchable Archives:
> http://www.mail-archive.com/mailman-developers%40python.org/
> Unsubscribe:
> https://mail.python.org/mailman/options/mailman-developers/raj.abhilash1%40gmail.com
> 
> Security Policy: http://wiki.list.org/x/QIA9

-- 
thanks,
Abhilash Raj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20150528/8366ee2d/attachment.sig>


More information about the Mailman-Developers mailing list