{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"# Doesn't work because kaggle has a tough time with gdal\n# will see if I can factor out cubist from https://github.com/GeoscienceAustralia/uncover-ml\n!add-apt-repository ppa:ubuntugis/ppa ","execution_count":8,"outputs":[{"output_type":"stream","text":"/bin/sh: 1: add-apt-repository: not found\r\n","name":"stdout"}]},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"!pip install git+https://github.com/GeoscienceAustralia/uncover-ml.git","execution_count":2,"outputs":[{"output_type":"stream","text":"Collecting git+https://github.com/GeoscienceAustralia/uncover-ml.git\n  Cloning https://github.com/GeoscienceAustralia/uncover-ml.git to /tmp/pip-req-build-b1mrbnuh\nRequirement already satisfied: numpy>=1.9.2 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (1.16.2)\nCollecting pycontracts==1.7.9 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/5e/d3/e80a539a45f6c8b58e9ec9ff69abc344399103388d56476b1654b0f86259/PyContracts-1.7.9.tar.gz (61kB)\n\u001b[K    100% |████████████████████████████████| 61kB 3.9MB/s ta 0:00:011\n\u001b[?25hRequirement already satisfied: tables>=3.2.2 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (3.4.4)\nCollecting rasterio==0.36.0 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/59/f7/040531ab12b4a4522b7fd99eec39258b78b82c67e3adcf81f25ee4a3e544/rasterio-0.36.0.tar.gz (1.2MB)\n\u001b[K    100% |████████████████████████████████| 1.2MB 21.7MB/s ta 0:00:01\n\u001b[?25hCollecting affine==2.0.0.post1 (from uncover-ml==0.1.0)\n  Downloading https://files.pythonhosted.org/packages/bf/df/d175613af5ec13cfe83e8bc1249f647ca6d55dd33565ce9433cf0e00daa9/affine-2.0.0.post1-py3-none-any.whl\nCollecting pyshp==1.2.3 (from uncover-ml==0.1.0)\n  Downloading https://files.pythonhosted.org/packages/e1/90/f6a8734f6fbf31cc1d133e90c9dfa4ddf34fa6e387e44fbd79b0cf38a14e/pyshp-1.2.3.tar.gz\nCollecting click==6.6 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/1c/7c/10b4132dd952b6a04e37626258825b8aa8c1eb99545f2eb26a77c21efb55/click-6.6-py2.py3-none-any.whl (71kB)\n\u001b[K    100% |████████████████████████████████| 71kB 29.7MB/s ta 0:00:01\n\u001b[?25hRequirement already satisfied: pywavelets==0.5.2 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (0.5.2)\nCollecting revrand>=0.9.10 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/df/35/280e3bf15f0ec383c4b5f788914566a90e64c8fee9029115c066b5c56e7a/revrand-1.0.0.tar.gz (47kB)\n\u001b[K    100% |████████████████████████████████| 51kB 26.2MB/s ta 0:00:01\n\u001b[?25hCollecting mpi4py==2.0.0 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/ee/b8/f443e1de0b6495479fc73c5863b7b5272a4ece5122e3589db6cd3bb57eeb/mpi4py-2.0.0.tar.gz (1.3MB)\n\u001b[K    100% |████████████████████████████████| 1.3MB 20.6MB/s ta 0:00:01\n\u001b[?25hRequirement already satisfied: scipy>=0.15.1 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (1.1.0)\nCollecting scikit-learn==0.18.1 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/ae/d2/efa7f8bef195c459a527edc58bf863bd44fde727630486cb8256e9a5a326/scikit_learn-0.18.1-cp36-cp36m-manylinux1_x86_64.whl (11.8MB)\n\u001b[K    100% |████████████████████████████████| 11.8MB 3.8MB/s eta 0:00:01\n\u001b[?25hRequirement already satisfied: scikit-image>=0.12.3 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (0.14.2)\nRequirement already satisfied: wheel>=0.29.0 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (0.31.1)\nRequirement already satisfied: PyYAML>=3.11 in /opt/conda/lib/python3.6/site-packages (from uncover-ml==0.1.0) (3.12)\nCollecting GDAL>=2.0.0 (from uncover-ml==0.1.0)\n\u001b[?25l  Downloading https://files.pythonhosted.org/packages/7c/b0/a2ecb10a68a319910c4681f452c83843b99c4ef6231d33a8e55b0104a50c/GDAL-2.4.0.tar.gz (564kB)\n\u001b[K    100% |████████████████████████████████| 573kB 33.4MB/s ta 0:00:01\n\u001b[?25h    Complete output from command python setup.py egg_info:\n    running egg_info\n    creating pip-egg-info/GDAL.egg-info\n    writing pip-egg-info/GDAL.egg-info/PKG-INFO\n    writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt\n    writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt\n    writing manifest file 'pip-egg-info/GDAL.egg-info/SOURCES.txt'\n    Traceback (most recent call last):\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 151, in fetch_config\n        p = subprocess.Popen([command, args], stdout=subprocess.PIPE)\n      File \"/opt/conda/lib/python3.6/subprocess.py\", line 709, in __init__\n        restore_signals, start_new_session)\n      File \"/opt/conda/lib/python3.6/subprocess.py\", line 1344, in _execute_child\n        raise child_exception_type(errno_num, err_msg, err_filename)\n    FileNotFoundError: [Errno 2] No such file or directory: '../../apps/gdal-config': '../../apps/gdal-config'\n    \n    During handling of the above exception, another exception occurred:\n    \n    Traceback (most recent call last):\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 237, in get_gdal_config\n        return fetch_config(option, gdal_config=self.gdal_config)\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 154, in fetch_config\n        raise gdal_config_error(e)\n    __main__.gdal_config_error: [Errno 2] No such file or directory: '../../apps/gdal-config': '../../apps/gdal-config'\n    \n    During handling of the above exception, another exception occurred:\n    \n    Traceback (most recent call last):\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 151, in fetch_config\n        p = subprocess.Popen([command, args], stdout=subprocess.PIPE)\n      File \"/opt/conda/lib/python3.6/subprocess.py\", line 709, in __init__\n        restore_signals, start_new_session)\n      File \"/opt/conda/lib/python3.6/subprocess.py\", line 1344, in _execute_child\n        raise child_exception_type(errno_num, err_msg, err_filename)\n    FileNotFoundError: [Errno 2] No such file or directory: 'gdal-config': 'gdal-config'\n    \n    During handling of the above exception, another exception occurred:\n    \n    Traceback (most recent call last):\n      File \"<string>\", line 1, in <module>\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 430, in <module>\n        setup(**setup_kwargs)\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/__init__.py\", line 129, in setup\n        return distutils.core.setup(**attrs)\n      File \"/opt/conda/lib/python3.6/distutils/core.py\", line 148, in setup\n        dist.run_commands()\n      File \"/opt/conda/lib/python3.6/distutils/dist.py\", line 955, in run_commands\n        self.run_command(cmd)\n      File \"/opt/conda/lib/python3.6/distutils/dist.py\", line 974, in run_command\n        cmd_obj.run()\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/command/egg_info.py\", line 278, in run\n        self.find_sources()\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/command/egg_info.py\", line 293, in find_sources\n        mm.run()\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/command/egg_info.py\", line 524, in run\n        self.add_defaults()\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/command/egg_info.py\", line 560, in add_defaults\n        sdist.add_defaults(self)\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/command/py36compat.py\", line 36, in add_defaults\n        self._add_defaults_ext()\n      File \"/opt/conda/lib/python3.6/site-packages/setuptools/command/py36compat.py\", line 119, in _add_defaults_ext\n        build_ext = self.get_finalized_command('build_ext')\n      File \"/opt/conda/lib/python3.6/distutils/cmd.py\", line 299, in get_finalized_command\n        cmd_obj.ensure_finalized()\n      File \"/opt/conda/lib/python3.6/distutils/cmd.py\", line 107, in ensure_finalized\n        self.finalize_options()\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 287, in finalize_options\n        self.gdaldir = self.get_gdal_config('prefix')\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 243, in get_gdal_config\n        return fetch_config(option)\n      File \"/tmp/pip-install-wh39q5qh/GDAL/setup.py\", line 154, in fetch_config\n        raise gdal_config_error(e)\n    __main__.gdal_config_error: [Errno 2] No such file or directory: 'gdal-config': 'gdal-config'\n    \n    ----------------------------------------\n\u001b[31mCommand \"python setup.py egg_info\" failed with error code 1 in /tmp/pip-install-wh39q5qh/GDAL/\u001b[0m\n","name":"stdout"}]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","collapsed":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":false},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.4","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}