Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add windows section and how to create a conda environment in the installation guide #1635

Merged
merged 1 commit into from
May 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 66 additions & 7 deletions guides/01-Installation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
"```"
]
Expand All @@ -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",
Expand All @@ -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",
"```"
]
},
{
Expand Down