You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"## Install environment with Anaconda or Miniconda\r\n",
27
-
"\r\n",
28
-
"### Conda\r\n",
29
-
"\r\n",
30
-
"It's highly recommanded to use [Conda](https://docs.conda.io/projects/conda/en/latest/) for the installation. Without Conda the installation of the dependencies can be cumbersome. If it is not already installed, download the latest version of [Anaconda](https://www.anaconda.com/) or [Miniconda](https://conda.io/miniconda.html) and execute it.\r\n",
31
-
"\r\n",
32
-
"### Install dependencies\r\n",
33
-
"\r\n",
34
-
"Open a command prompt (Windows) or shell (Mac, Linux)\r\n",
"Before leaving the *Environments* section of Anaconda, make sure that the CLIMADA environment, *climada_env* is selected. Go to the *Home* section of Anaconda and install and launch Spyder (or your preferred editor). Open the file containing all the installation tests, ``tests_install.py`` in ``climada_python-x.y.z`` folder and execute it. If the installation has been successful, an OK will appear at the end (the execution should last less than 2 min).\r\n",
53
-
"\r\n",
54
-
"### Run tutorials\r\n",
55
-
"\r\n",
56
-
"In the *Home* section of Anaconda, with *CLIMADA_env* selected, install and launch *jupyter notebook*. A browser window will show up. Navigate to your ``CLIMADA_python-x.y.z`` repository and open ``doc/tutorial/1_main_CLIMADA.ipynb``. This is the tutorial which will guide you through all CLIMADA's functionalities. Execute each code cell to see the results, you might also edit the code cells before executing. See [tutorials](https://github.com/CLIMADA-project/climada_python/tree/main/doc/tutorial) for more information.\r\n",
57
-
"\r\n",
58
-
"### Workaround if **Spyder** installation in Anaconda fails for *climada_env*.\r\n",
"--> returns a path, like /Users/XXX/opt/anaconda3/envs/climada_env/bin/python\r\n",
67
-
"```\r\n",
68
-
"\r\n",
69
-
"Start Anaconda, create a new python_env environment (just click create and enter the name, then press Create) and install latest Spyder in there (currently 4.1.5), start this Spyder, then, after Spyder has started, navigate to Preferences > Python Interpreter > Use the following interpreter and paste the path from above (e.g. /Users/XXX/opt/anaconda3/envs/CLIMADA_env/bin/python) into the text box. Start a new IPython console and run ``tests_install.py``.\r\n",
70
-
"\r\n",
71
-
"## FAQs\r\n",
72
-
"\r\n",
73
-
"* ModuleNotFoundError; CLIMADA libraries are not found. Try to include *climada_python-x.y.z* path in the environment *climada_env* path as suggested in Section 2 of [Install environment with Anaconda]. If it does not work you can always include the path manually before executing your code:\r\n",
"* ModuleNotFoundError; some python library is not found. It might happen that the pip dependencies of *env_climada.yml* (the ones specified after ``pip:``) have not been installed in the environment *climada_env*. You can then install them manually one by one as follows:\r\n",
82
-
"\r\n",
83
-
" ```bash\r\n",
84
-
" conda activate climada_env\r\n",
85
-
" pip install library_name\r\n",
86
-
" ```\r\n",
87
-
"\r\n",
88
-
" where ``library_name`` is the missing library.\r\n",
89
-
"\r\n",
90
-
" Another reason may be a recent update of the operating system (macOS). In this case removing and reinstalling Anaconda will be required.\r\n",
91
-
"\r\n",
92
-
"* Conda permission error (``operation not permitted``) in macOS Mojave: try the solutions suggested here [https://github.com/conda/conda/issues/8440](https://github.com/conda/conda/issues/8440)\r\n",
93
-
"\r\n",
94
-
"* No 'impf\\_TC' column in GeoDataFrame: This may happen when a demo file from CLIMADA was not updated after the change in the impact function naming pattern from 'if\\_' to 'impf\\_' ([climada v2.2.0](https://github.com/CLIMADA-project/climada_python/releases/tag/v2.2.0)).\r\n",
95
-
" To solve it, run `python -c 'import climada; climada.setup_climada_data(reload=True)` in a terminal.\r\n",
96
-
"\r\n",
97
-
"* How to change the log level: By default the logging level is set to ``'INFO'``, which is quite verbose. This can be changed\r\n",
98
-
"\r\n",
99
-
" * programmatically, in a script or interactive python environment (Spyder, Jupyter, IPython) by executing e.g., ``from climada.util.config import LOGGER; from logging import WARNING; LOGGER.setLevel(WARNING)``, \r\n",
100
-
"\r\n",
101
-
" * through configuration, by editing the config file ``CLIMADA/conf/defaults.conf`` and setting the value of the ``global.log_level`` property.\r\n"
102
-
],
103
-
"metadata": {}
10
+
"# Installation\n",
11
+
"\n",
12
+
"Please execute the instructions of the following text boxes in a Terminal or Anaconda Prompt. Chose an installation directory, e.g., the user's home directory. In the following it will be referred to as `$[installation directory]`.\n"
"It's highly recommanded to install CLIMADA into a [Conda](https://docs.conda.io/projects/conda/en/latest/) environment. Without Conda, the installation of the dependencies can be cumbersome. If it is not already installed, download the latest version of [Anaconda](https://www.anaconda.com/) or [Miniconda](https://conda.io/miniconda.html) and execute it.\n",
40
+
"\n",
41
+
"Open a command prompt (Windows) or shell (Mac, Linux) and run:\n",
"Include the CLIMADA path into the Conda environment as follows:\n",
51
+
"\n",
52
+
"```bash\n",
53
+
"pip install -e climada_python\n",
54
+
"```\n",
55
+
"\n",
56
+
"With this setup, changes to CLIMADA's source code will immediately take effect. It removes the need to reinstall during development."
57
+
]
58
+
},
59
+
{
60
+
"cell_type": "markdown",
61
+
"id": "7f94bbf8-5429-437c-8602-e11c79c92d40",
62
+
"metadata": {
63
+
"jp-MarkdownHeadingCollapsed": true,
64
+
"tags": []
65
+
},
66
+
"source": [
67
+
"## Install CLIMADA from PyPi (alternative)\n",
68
+
"\n",
69
+
"Published releases of CLIMADA (not CLIMADA-petals) can also be installed from the PyPi repository https://pypi.org/project/climada/, since version 3.0.\n",
70
+
"\n",
71
+
"### Set up the environment\n",
72
+
"\n",
73
+
"Download the environment specification file from the git repository and save it locally, then create the conda environment:\n",
"Include the CLIMADA-petals path into the Conda environment as follows:\n",
121
+
"\n",
122
+
"```bash\n",
123
+
"pip install -e climada_petals\n",
124
+
"```\n",
125
+
"\n",
126
+
"In case of a separate environment for CLIMADA-petals, one needs to install the core package as well, either with the package from PyPi (`pip install climada`) or from local sources (`pip install -e climada_python`)"
"If the installation has been successful, an OK will appear at the end (the execution shouldn't last more than 2 min).\n",
144
+
"\n",
145
+
"\n",
146
+
"### Run tutorials\n",
147
+
"\n",
148
+
"In the *Home* section of Anaconda, with `climada_env` selected, install and launch `jupyter notebook`. A browser window will show up. Navigate to your ``climada_python`` repository and open ``doc/tutorial/1_main_CLIMADA.ipynb``. This is the tutorial which will guide you through all CLIMADA's functionalities. Execute each code cell to see the results, you might also edit the code cells before executing. See [tutorials](https://github.com/CLIMADA-project/climada_python/tree/main/doc/tutorial) for more information."
149
+
]
150
+
},
151
+
{
152
+
"cell_type": "markdown",
153
+
"id": "b943087a-ca5b-4da2-bc04-9f9d491fcd5d",
154
+
"metadata": {},
155
+
"source": [
156
+
"## Working with _Spyder_\n",
157
+
"\n",
158
+
"It is possible to use climada in combination with the [Spyder-IDE](https://www.spyder-ide.org/). However, depending on OS, CLIMADA version, Spyder version and installation tool, installing `spyder` into the `climada_env` environment may fail. In particular, MacOS and `conda install spyder` don't work well together. Although there are cases where `pip install spyder` bears satisfactory results, it is suggested to install `spyder` in a separate Conda environment and run it with the python interpreter from the `climada_env` environment instead. To do so, follow these instructions:\n",
159
+
"\n",
160
+
"- Start Anaconda, create a new python_env environment (just click create and enter the name, then press Create) and install latest Spyder in there (currently 4.2.5). Start this version of Spyder. After Spyder has started, navigate to *Preferences > Python Interpreter > Use the following interpreter* and paste the output of the following terminal command into the text box:\n",
"# this returns a path, like /Users/XXX/opt/anaconda3/envs/climada_env/bin/python\n",
166
+
"```\n",
167
+
"\n",
168
+
"\n",
169
+
"- Obtain the version of the package `spyder-kernels` (currently 1.10.2) that has automatically been installed along with Spyder in the Anaconda environment and install the same version of `spyder-kernels` in the `climada_env` environment:\n",
170
+
"\n",
171
+
"```bash\n",
172
+
"conda activate climada_env \n",
173
+
"conda install spyder-kernels=1.10.2\n",
174
+
"```\n",
175
+
"\n",
176
+
"- Start a new IPython console in Spyder and run ``tests_install.py``."
177
+
]
178
+
},
179
+
{
180
+
"cell_type": "markdown",
181
+
"id": "9d550564-ddac-4b9a-a780-05274aa4321d",
182
+
"metadata": {},
183
+
"source": [
184
+
"## FAQs\n",
185
+
"\n",
186
+
"* **ModuleNotFoundError**\n",
187
+
" * the CLIMADA packages are not found. \\\n",
188
+
" Check whether the climada environment is activated. If not, activate it (`conda activate climada_env`). Otherwise, the installation has failed. Try and follow the installation instructions above.\n",
189
+
" * an external python library is not found. \\\n",
190
+
" It might happen that the pip dependencies of `env_climada.yml` (the ones specified after ``pip:``) have not been installed in the environment `climada_env`.\n",
191
+
" They can be installed manually one by one as follows:\n",
192
+
" ```bash\n",
193
+
" conda activate climada_env\n",
194
+
" pip install library_name\n",
195
+
" ```\n",
196
+
" where ``library_name`` is the missing library.\\\n",
197
+
" Another reason may be a recent update of the operating system (macOS). In this case removing and reinstalling Anaconda will be required.\n",
198
+
"\n",
199
+
"\n",
200
+
"* **Conda permission error**\\\n",
201
+
" (``operation not permitted``) in macOS Mojave: try the solutions suggested here [https://github.com/conda/conda/issues/8440](https://github.com/conda/conda/issues/8440)\n",
202
+
"\n",
203
+
"* **No 'impf\\_TC' column in GeoDataFrame**\\\n",
204
+
" This may happen when a demo file from CLIMADA was not updated after the change in the impact function naming pattern from 'if\\_' to 'impf\\_' ([climada v2.2.0](https://github.com/CLIMADA-project/climada_python/releases/tag/v2.2.0)).\\\n",
205
+
" To solve it, run `python -c 'import climada; climada.setup_climada_data(reload=True)` in a terminal.\n",
206
+
"\n",
207
+
"* **How to change the log level**\\\n",
208
+
" By default the logging level is set to ``'INFO'``, which is quite verbose. This can be changed\n",
209
+
"\n",
210
+
" * through configuration, by editing the config file `climada.conf` (see Guide_configuration.ipynb) and setting the value of the ``global.log_level`` property.\n",
211
+
"\n",
212
+
" * programmatically, globally, in a script or interactive python environment (Spyder, Jupyter, IPython) by executing e.g.,\n",
213
+
" ```python\n",
214
+
" from climada.util.config import LOGGER\n",
215
+
" from logging import WARNING\n",
216
+
" LOGGER.setLevel(WARNING)\n",
217
+
" ```\n",
218
+
"\n",
219
+
" * programmatically, context based, using `climada.util.log_level`:\n",
0 commit comments