【问题标题】:What is the default install path for poetry诗歌的默认安装路径是什么
【发布时间】:2022-05-10 22:14:20
【问题描述】:

我安装了诗歌,但是在尝试调用诗歌时出现以下错误

zsh: command not found: poetry 

我知道我已经安装了它,因为我在尝试运行以下安装脚本时得到以下输出

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python                                                                             
Retrieving Poetry metadata                                                                                                                                                                    

Latest version already installed.

【问题讨论】:

    标签: python python-poetry


    【解决方案1】:

    默认安装位置是~/.poetry/bin/poetry

    我将以下内容添加到我的.zshrc

    export PATH=$PATH:$HOME/.poetry/bin
    

    【讨论】:

    • 当我使用 cURL 调用安装它时,它没有安装在那里。如果我这样做cd $HOME & ls -a,则没有 .poetry 文件:'(。当我对诗歌进行 grep 时,./Library/Application Support/pypoetry 会出现大量结果。知道为什么会这样或如何解决吗?谢谢!
    • 我会检查 curl 命令执行的文件,很可能会找到放置位置的线索
    【解决方案2】:

    最初我想在公寓环境中运行诗歌。运行后

        pip install poetry
    

    我看到它是使用我的本地 Python 安装的,并且没有链接到 conda 环境。就我而言,我添加了

        export PATH="$HOME/.local/bin:$PATH"
    

    到我的主目录下的 .zshrc 文件的末尾。

    提示:对于 MacOS,您可以使用 Command+Shift+Dot 查看隐藏的文件和文件夹 :)

    【讨论】:

      【解决方案3】:

      official poetry installer的新版本更新:

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

      此版本将安装在您的默认python3 bin 中。例如:$HOME/Library/Python/3.9/bin,安装程序会将位置打印到您的 shell。

      添加

      export PATH=$HOME/Library/Python/3.9/bin:$PATH
      

      ~/.profile~/.zprofile

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-01
        • 1970-01-01
        • 1970-01-01
        • 2017-12-20
        相关资源
        最近更新 更多