Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Add installation instructions through conda-forge #5498

Merged
merged 5 commits into from
Dec 9, 2021
Merged
Changes from 4 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
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,33 @@ to distribute as a plugin, see the [subcommand API docs](https://docs.allennlp.o
## Installation

AllenNLP requires Python 3.6.1 or later and [PyTorch](https://pytorch.org/).
It's recommended that you install the PyTorch ecosystem **before** installing AllenNLP by following the instructions on [pytorch.org](https://pytorch.org/).

The preferred way to install AllenNLP is via `pip`. Just run `pip install allennlp`.
We support AllenNLP on Mac and Linux environments. We presently do not support Windows but are open to contributions.

> ⚠️ If you're using Python 3.7 or greater, you should ensure that you don't have the PyPI version of `dataclasses` installed after running the above command, as this could cause issues on certain platforms. You can quickly check this by running `pip freeze | grep dataclasses`. If you see something like `dataclasses=0.6` in the output, then just run `pip uninstall -y dataclasses`.
### Installing via conda-forge

If you need pointers on setting up an appropriate Python environment or would like to install AllenNLP using a different method, see below.
The simplest way to install AllenNLP is using conda:

We support AllenNLP on Mac and Linux environments. We presently do not support Windows but are open to contributions.
```
conda install -c conda-forge python=3.8 allennlp
```

All plugins mentioned above are similarly installable, e.g.

```
conda install -c conda-forge allennlp-models allennlp-semparse allennlp-server allennlp-optuna
```

### Installing via pip

It's recommended that you install the PyTorch ecosystem **before** installing AllenNLP by following the instructions on [pytorch.org](https://pytorch.org/).

After that, just run `pip install allennlp`.

> ⚠️ If you're using Python 3.7 or greater, you should ensure that you don't have the PyPI version of `dataclasses` installed after running the above command, as this could cause issues on certain platforms. You can quickly check this by running `pip freeze | grep dataclasses`. If you see something like `dataclasses=0.6` in the output, then just run `pip uninstall -y dataclasses`.

If you need pointers on setting up an appropriate Python environment or would like to install AllenNLP using a different method, see below.

#### Setting up a virtual environment

[Conda](https://conda.io/) can be used set up a virtual environment with the
Expand All @@ -197,13 +212,13 @@ environment you want to use, you can skip to the 'installing via pip' section.
2. Create a Conda environment with Python 3.7 (3.6 or 3.8 would work as well):

```
conda create -n allennlp python=3.7
conda create -n allennlp_env python=3.7
```

3. Activate the Conda environment. You will need to activate the Conda environment in each terminal in which you want to use AllenNLP:

```
conda activate allennlp
conda activate allennlp_env
```

#### Installing the library and dependencies
Expand Down