diff --git a/ansible/deploy.yaml b/ansible/deploy.yaml
index 68a2244fb8e8498b9086138580e4ffc1eeee283f..22e902e75100e13dfb028bc134342125150dae63 100644
--- a/ansible/deploy.yaml
+++ b/ansible/deploy.yaml
@@ -129,14 +129,16 @@
         command: "runmodwsgi --setup-only --port=80 --user ippidb --group wheel --server-root=/etc/ippidb-80"
         app_path: "/home/{{ deploy_user_name }}/ippidb-web/ippisite"
         settings: "ippisite.{{ ansible_hostname }}_settings"
-    - name: add line in generated WSGI handler script to set DJANGO_SETTINGS_MODULE
+    - name: add line in generated WSGI handler script to set DJANGO_SETTINGS_MODULE and BABEL_LIBDIR for openbabel formats
       blockinfile:
         path: /etc/ippidb-80/handler.wsgi
         insertbefore: BOF
         content: |
           # added by ansible deployment script to use the right django settings file
+          # and set correctly the openbabel formats directory
           import os
           os.environ['DJANGO_SETTINGS_MODULE'] = 'ippisite.hub16_settings'
+          os.environ['BABEL_LIBDIR'] = '/usr/lib64/openbabel/'
     - name: create or update database
       become_user: "{{ deploy_user_name }}"
       django_manage: