First, configure a global pip mirror:
1 | pip config --user set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple |
Then download the Poetry installer script locally, for example as install-poetry.py:
1 | curl -sSL https://install.python-poetry.org -o install-poetry.py |
Open the script and find this function:
1 | def pip(self, *args, **kwargs) -> subprocess.CompletedProcess: |
Remove "--isolated" from that call. After that, when the installer invokes pip, it will use the mirror you configured earlier.
Then run the installer:
1 | python3 install-poetry.py |