From a20ad2524ac62c9c2a0b69af417c35cd5d4fbec7 Mon Sep 17 00:00:00 2001 From: cmongut Date: Mon, 11 May 2020 13:01:51 +0200 Subject: [PATCH] Add windows section and how to create a conda environment in the installation guide --- guides/01-Installation.ipynb | 73 ++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/guides/01-Installation.ipynb b/guides/01-Installation.ipynb index 216ab7426..2db8b6eb7 100644 --- a/guides/01-Installation.ipynb +++ b/guides/01-Installation.ipynb @@ -6,14 +6,40 @@ "source": [ "## Installation\n", "\n", - "This guide is intended for those who are using CARTOframes for the first time and provides the steps to install it **locally**, in a **Jupyter Notebook**, or using a **Virtual Environment**. You need **Python 3** to use CARTOframes." + "This guide is intended for those who are using CARTOframes for the first time. It covers:\n", + "- The **Python version** required\n", + "- How to install it using **pip**\n", + "- How to install it in a **Jupyter Notebook**\n", + "- How to install it in **Windows**\n", + "- How to create a **Virtual Enviroment**\n", + "- Considerations in **Jupyter Lab**\n", + "- Metrics\n", + "\n", + "> We recommend installing CARTOframes in a [Virtual Environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/), since they are very useful when working with Python locally.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Install CARTOframes using `pip`\n", + "### Python version required\n", + "\n", + "CARTOframes needs Python 3 to work properly. You can check your version by running:\n", + "\n", + "```\n", + "python --version\n", + "```\n", + "\n", + "You should get some output like Python 3.6.3. If you do not have Python, please install the latest 3.x version from [python.org](https://python.org/) or refer to the [Installing Python](http://docs.python-guide.org/en/latest/starting/installation/) section of the Hitchhiker’s Guide to Python." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "heading_collapsed": true + }, + "source": [ + "### Install it using `pip`\n", "\n", "CARTOframes can be installed with [`pip`](https://pypi.org/project/pip/) by simply typing one of the following commands to do a system install:\n", "\n", @@ -35,22 +61,37 @@ "pip install cartoframes==1.x.y\n", "```\n", "\n", - "#### Optional dependencies\n", + "#### Optional dependency\n", "\n", - "- [RTree](https://github.com/Toblerity/rtree) is a spatial index package to improve performance and required for overlay operations. It provides an interface to [libspatialindex](https://github.com/libspatialindex/libspatialindex)." + "[RTree](https://github.com/Toblerity/rtree) is a spatial index package to improve performance and required for overlay operations. It provides an interface to [libspatialindex](https://github.com/libspatialindex/libspatialindex)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Use a Jupyter Notebook\n", + "### Install it in a Jupyter Notebook\n", "\n", "In the CARTOframes Developer Center, all of the examples are created with [Jupyter Notebooks](https://jupyter.org/). If you aren't familiar with Jupyter Notebooks, we recommend reading the [beginner documentation](https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html) to get familiar with the environment.\n", "\n", "To install CARTOframes through a Jupyter Notebook, run this command:\n", "\n", "```bash\n", + "!pip install cartoframes\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Install it in Windows\n", + "\n", + "In order to work properly, CARTOframes needs that [Shapely](https://github.com/Toblerity/Shapely) and [Fiona](https://github.com/Toblerity/Fiona) libraries are already installed in your system. Execute these commands to install CARTOframes correctly:\n", + "\n", + "```bash\n", + "pip install shapely\n", + "conda install -c conda-forge fiona\n", "pip install cartoframes\n", "```" ] @@ -61,7 +102,7 @@ "source": [ "### Use a Virtual Environment\n", "\n", - "We recommend installing CARTOframes in a [Virtual Environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/), since they are very useful when working with Python locally. This section provides the necessary information to create a simple Virtual Environment and install CARTOframes inside of it:\n", + "This section provides the necessary information to create a simple Virtual Environment with virtualenv and conda and also how to install CARTOframes inside of it.\n", "\n", "```bash\n", "$ virtualenv cartoframes_env\n", @@ -73,7 +114,25 @@ "\n", "```bash\n", "(cartoframes_env) $ deactivate\n", - "```\n" + "```\n", + "\n", + "#### Conda users\n", + "\n", + "Let's see how to achieve it with conda.\n", + "\n", + "```bash\n", + "$ conda create --name cartoframes_env\n", + "$ conda activate cartoframes_env\n", + "(cartoframes_env) $ pip install shapely\n", + "(cartoframes_env) $ conda install -c conda-forge fiona\n", + "(cartoframes_env) $ pip install cartoframes\n", + "```\n", + "\n", + "When the virtual environment is activated, it is visible in the command line prompt, in this case: `(cartoframes_env)`. It can be deactivated by typing `deactivate` to exit the virtualenv:\n", + "\n", + "```bash\n", + "(cartoframes_env) $ conda deactivate\n", + "```" ] }, {