Re: [Mailman-Developers] help with ImportError: No module named 'psycopg2'
On Wed, 27 May 2015 21:44:51 +0300 Danil Smirnov <danil@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@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@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%40g...
Security Policy: http://wiki.list.org/x/QIA9
-- thanks, Abhilash Raj
2015-05-27 22:57 GMT+03:00 Abhilash Raj <raj.abhilash1@gmail.com>:
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)
Thanks Abhilash! It works! :)
Abhilash Raj writes:
Subject: Re: [Mailman-Developers] help with ImportError: No module named 'psycopg2'
[body omitted]
Abhilash, that post had a signal to noise ratio of 0.08 by line count, and it would be worse in bytes. Please trim. If you don't want to trim because you're on a handheld device, at least *top-post*, and don't forget to apologize so that people *know* it's a top-post (in contravention to ordinary practice on *this* list; see http://turnbull.sk.tsukuba.ac.jp/Teach/ESES/socsys.html for analysis).
Hi Steve,
On May 28, 2015 5:55 AM, "Stephen J. Turnbull" <stephen@xemacs.org> wrote:
Abhilash, that post had a signal to noise ratio of 0.08 by line count,
I am sorry, I noticed that just now. I usually do trim messages, but I remember I was working on something while sending in the last mail and totally forgot about the length. Thanks for pointing out though, will surely keep that in mind from now on.
thanks, Abhilash
participants (3)
-
Abhilash Raj
-
Danil Smirnov
-
Stephen J. Turnbull