poetry command not found

腾讯云服务器 make install && poetry install ,提示异常信息

[root@VM-0-5-centos wechat-chatgpt]# npm install && poetry install
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 511 packages in 38s

78 packages are looking for funding
  run `npm fund` for details
bash: poetry: command not found...

下一步安装poetry

按照网上的教程按照提示异常

请看官方链接 Introduction | Documentation | Poetry - Python dependency management and packaging made easy

[root@VM-0-5-centos wechat-chatgpt]# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
Retrieving Poetry metadata

This installer is deprecated, and scheduled for removal from the Poetry repository on or after January 1, 2023.
See https://github.com/python-poetry/poetry/issues/6377 for details.

You should migrate to https://install.python-poetry.org instead, which supports all versions of Poetry, and allows for `self update` of versions 1.1.7 or newer.
Instructions are available at https://python-poetry.org/docs/#installation.

Without an explicit version, this installer will attempt to install the latest version of Poetry.
This installer cannot install Poetry 1.2.0a1 or newer (and installs will be unable to `self update` to 1.2.0a1 or newer).

To continue to use this deprecated installer, you must specify an explicit version with --version <version> or POETRY_VERSION=<version>.
Alternatively, if you wish to force this deprecated installer to use the latest installable release, set GET_POETRY_IGNORE_DEPRECATION=1.

Version 1.2.2 is not supported by this installer! Please specify a version prior to 1.2.0a1 to continue!

Linux, macOS, Windows (WSL)

curl -sSL https://install.python-poetry.org | python3 -

Note: On some systems, python may still refer to Python 2 instead of Python 3. We always suggest the python3 binary to avoid ambiguity.

Windows (Powershell)

(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

If you have installed Python through the Microsoft Store, replace py with python in the command above.

我的安装过程

[root@VM-0-5-centos wechat-chatgpt]# curl -sSL https://install.python-poetry.org | python3 -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/root/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.2.2): Done

Poetry (1.2.2) is installed now. Great!

To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
environment variable.

Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

[root@VM-0-5-centos wechat-chatgpt]# poetry --version

 

看描述信息,下一步

配置环境变量Add Poetry to your PATH

The installer creates a poetry wrapper in a well-known, platform-specific directory:

  • $HOME/.local/bin on Unix.
    %APPDATA%\Python\Scripts on Windows.
    $POETRY_HOME/bin if $POETRY_HOME is set.

If this directory is not present in your $PATH, you can add it in order to invoke Poetry as poetry.

Alternatively, the full path to the poetry binary can always be used:

  • ~/Library/Application Support/pypoetry/venv/bin/poetry on MacOS.
    ~/.local/share/pypoetry/venv/bin/poetry on Linux/Unix.
    %APPDATA%\pypoetry\venv\Scripts\poetry on Windows.
    $POETRY_HOME/venv/bin/poetry if $POETRY_HOME is set.

    我配在了/etc/profile 

  • export PATH="/root/.local/bin:$PATH

猜你喜欢

转载自blog.csdn.net/u013985879/article/details/128255659