Commit 044b7d30 by Sébastien Eustace Committed by GitHub

Reorgnize installation instructions (#4933)

parent 6a35cc41
...@@ -17,28 +17,46 @@ It allows you to declare the libraries your project depends on and it will manag ...@@ -17,28 +17,46 @@ It allows you to declare the libraries your project depends on and it will manag
## System requirements ## System requirements
Poetry requires Python 3.6+. It is multi-platform and the goal is to make it work equally well Poetry requires **Python 3.6+**. It is multi-platform and the goal is to make it work equally well
on Windows, Linux and OSX. on Windows, Linux and OSX.
## Installation ## Installation
{{< tabs tabTotal="3" tabID1="installing-with-the-official-installer" tabID2="installing-with-pipx" tabID3="installing-with-pip" tabName1="With the official installer" tabName2="With pipx" tabName3="With pip" >}}
{{< tab tabID="installing-with-the-official-installer" >}}
Poetry provides a custom installer that will install `poetry` isolated Poetry provides a custom installer that will install `poetry` isolated
from the rest of your system. from the rest of your system.
### osx / linux / bashonwindows install instructions {{< steps >}}
{{< step >}}
**Install Poetry**
Install Poetry by downloading and executing the [installation script](https://install.python-poetry.org).
**osx / linux / bashonwindows install instructions**
```bash ```bash
curl -sSL https://install.python-poetry.org | python3 - curl -sSL https://install.python-poetry.org | python3 -
``` ```
### windows powershell install instructions
**windows powershell install instructions**
```powershell ```powershell
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
``` ```
{{% note %}}
Note that the installer does not support Python < 3.6.
{{% /note %}}
{{% warning %}} {{% warning %}}
The previous `get-poetry.py` installer is now deprecated, if you are currently using it The previous `get-poetry.py` installer is now deprecated, if you are currently using it
you should migrate to the new, supported, `install-poetry.py` installer. you should migrate to the new, supported, `install-poetry.py` installer.
{{% /warning %}} {{% /warning %}}
{{< /step >}}
{{< step >}}
**Add Poetry to your PATH**
The installer installs the `poetry` tool to Poetry's `bin` directory. This location depends on your system: The installer installs the `poetry` tool to Poetry's `bin` directory. This location depends on your system:
...@@ -49,6 +67,10 @@ If this directory is not on your `PATH`, you will need to add it manually ...@@ -49,6 +67,10 @@ If this directory is not on your `PATH`, you will need to add it manually
if you want to invoke Poetry with simply `poetry`. if you want to invoke Poetry with simply `poetry`.
Alternatively, you can use the full path to `poetry` to use it. Alternatively, you can use the full path to `poetry` to use it.
{{< /step >}}
{{< step >}}
**Check the installation**
Once Poetry is installed you can execute the following: Once Poetry is installed you can execute the following:
...@@ -57,14 +79,10 @@ poetry --version ...@@ -57,14 +79,10 @@ poetry --version
``` ```
If you see something like `Poetry (version 1.2.0)` then you are ready to use Poetry. If you see something like `Poetry (version 1.2.0)` then you are ready to use Poetry.
If you decide Poetry isn't your thing, you can completely remove it from your system {{< /step >}}
by running the installer again with the `--uninstall` option or by setting
the `POETRY_UNINSTALL` environment variable before executing the installer.
```bash {{< step >}}
curl -sSL https://install.python-poetry.org | python3 - --uninstall **Configure the installation**
curl -sSL https://install.python-poetry.org | POETRY_UNINSTALL=1 python3 -
```
By default, Poetry is installed into the user's platform-specific home directory. By default, Poetry is installed into the user's platform-specific home directory.
If you wish to change this, you may define the `POETRY_HOME` environment variable: If you wish to change this, you may define the `POETRY_HOME` environment variable:
...@@ -94,34 +112,81 @@ You can also install Poetry for a `git` repository by using the `--git` option: ...@@ -94,34 +112,81 @@ You can also install Poetry for a `git` repository by using the `--git` option:
```bash ```bash
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@master
```` ````
{{< /step >}}
{{% note %}} {{< step >}}
Note that the installer does not support Python < 3.6. **Update Poetry**
{{% /note %}}
If you want to install pre-release versions, you can use the `--preview` option.
```bash
poetry self update --preview
```
And finally, if you want to install a specific version, you can pass it as an argument
to `self update`.
### Alternative installation methods ```bash
poetry self update 1.2.0
```
#### Installing with `pipx` {{% warning %}}
Poetry versions installed using the now deprecated `get-poetry.py` installer will not be able to use this
command to update to 1.2 releases or later. Migrate to using the `install-poetry.py` installer or `pipx`.
{{% /warning %}}
{{< /step >}}
{{< step >}}
**Uninstall Poetry**
If you decide Poetry isn't your thing, you can completely remove it from your system
by running the installer again with the `--uninstall` option or by setting
the `POETRY_UNINSTALL` environment variable before executing the installer.
```bash
curl -sSL https://install.python-poetry.org | python3 - --uninstall
curl -sSL https://install.python-poetry.org | POETRY_UNINSTALL=1 python3 -
```
{{< /step >}}
{{< /steps >}}
{{< /tab >}}
{{< tab tabID="installing-with-pipx" >}}
Using [`pipx`](https://github.com/pipxproject/pipx) to install Poetry is also possible. Using [`pipx`](https://github.com/pipxproject/pipx) to install Poetry is also possible.
`pipx` is used to install Python CLI applications globally while still isolating them in virtual environments. `pipx` is used to install Python CLI applications globally while still isolating them in virtual environments.
This allows for clean upgrades and uninstalls. This allows for clean upgrades and uninstalls.
{{< steps >}}
{{< step >}}
**Install Poetry**
```bash ```bash
pipx install poetry pipx install poetry
``` ```
{{< /step >}}
{{< step >}}
**Update Poetry**
```bash ```bash
pipx upgrade poetry pipx upgrade poetry
``` ```
{{< /step >}}
{{< step >}}
**Uninstall Poetry**
```bash ```bash
pipx uninstall poetry pipx uninstall poetry
``` ```
{{< /step >}}
{{< /steps >}}
{{< /tab >}}
#### Installing with `pip` {{< tab tabID="installing-with-pip" >}}
Using `pip` to install Poetry is possible. Using `pip` to install Poetry is possible.
...@@ -134,31 +199,9 @@ Be aware that it will also install Poetry's dependencies ...@@ -134,31 +199,9 @@ Be aware that it will also install Poetry's dependencies
which might cause conflicts with other packages. which might cause conflicts with other packages.
{{% /warning %}} {{% /warning %}}
## Updating `poetry` {{< /tab >}}
Updating Poetry to the latest stable version is as simple as calling the `self update` command.
```bash
poetry self update
```
{{% warning %}}
Poetry versions installed using the now deprecated `get-poetry.py` installer will not be able to use this
command to update to 1.2 releases or later. Migrate to using the `install-poetry.py` installer or `pipx`.
{{% /warning %}}
If you want to install pre-release versions, you can use the `--preview` option.
```bash
poetry self update --preview
```
And finally, if you want to install a specific version, you can pass it as an argument {{< /tabs >}}
to `self update`.
```bash
poetry self update 1.2.0
```
## Enable tab completion for Bash, Fish, or Zsh ## Enable tab completion for Bash, Fish, or Zsh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment