open-contracting/kingfisher-colab

flattentool 0.15.0 breaks kingfisher-colab

Closed this issue · 1 comments

Steps to reproduce:

pip install --upgrade 'ocdskingfishercolab'
import json
import os
import pprint

import pandas
from google.colab.files import download
from ocdskingfishercolab import (
    create_connection, set_spreadsheet_name, list_source_ids, list_collections,
    set_search_path, execute_statement, get_dataframe_from_query,
    save_dataframe_to_sheet, save_dataframe_to_spreadsheet,
    download_data_as_json, download_package_from_ocid)
from psycopg2.sql import SQL, Identifier

Error:

ImproperlyConfigured                      Traceback (most recent call last)

/usr/local/lib/python3.6/dist-packages/flattentool/i18n.py in <module>()
     12     try:
---> 13         get_language()
     14     except ImproperlyConfigured:

10 frames

ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.


During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)

ImportError: 


During handling of the above exception, another exception occurred:

FileNotFoundError                         Traceback (most recent call last)

/usr/lib/python3.6/gettext.py in translation(domain, localedir, languages, class_, fallback, codeset)
    527         if fallback:
    528             return NullTranslations()
--> 529         raise OSError(ENOENT, 'No translation file found for domain', domain)
    530     # Avoid opening, reading, and parsing the .mo file after it's been done
    531     # once.

FileNotFoundError: [Errno 2] No translation file found for domain: 'flatten-tool'

As a workaround, I've updated the data feedback template to explicitly install flattentool<0.15 before installing kingfisher-colab.

cc @Bjwebb

Sorry about this, its looking for some files that should be generated in the install, but aren't for some reason. This should be fixed in the latest version 0.15.1 (relevant PR).