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

Fix Python 3.x install when python is still 2.x #2222

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ recommended way of installing `poetry`.
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
```

If you want to explicitly install with Python 3.x on a system where `python` invokes Python 2.x, use:

```bash
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
```

Alternatively, you can download the `get-poetry.py` file and execute it separately.

If you want to install prerelease versions, you can do so by passing `--preview` to `get-poetry.py`:
Expand Down
8 changes: 5 additions & 3 deletions get-poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def expanduser(path):
POETRY_LIB_BACKUP = os.path.join(POETRY_HOME, "lib-backup")


BIN = """#!/usr/bin/env python
BIN = """#!/usr/bin/env {}
# -*- coding: utf-8 -*-
import glob
import sys
Expand All @@ -211,7 +211,9 @@ def expanduser(path):
from poetry.console import main

main()
"""
""".format(
wohali marked this conversation as resolved.
Show resolved Hide resolved
os.path.basename(sys.executable)
)

BAT = u('@echo off\r\npython "{poetry_bin}" %*\r\n')

Expand Down Expand Up @@ -733,7 +735,7 @@ def set_windows_path_var(self, value):
HWND_BROADCAST,
WM_SETTINGCHANGE,
0,
u"Environment",
"Environment",
SMTO_ABORTIFHUNG,
5000,
ctypes.byref(result),
Expand Down