【问题标题】:Python Poetry Failing on UbuntuPython 诗歌在 Ubuntu 上失败
【发布时间】:2021-04-09 18:04:14
【问题描述】:

我正在尝试让 Poetry(python 依赖项管理器)在 Ubuntu 18.04 上运行,但每当尝试将包添加到项目中时,它都会抛出一个奇怪的错误。我尝试卸载并重新安装诗歌,但它什么也没做。 ubuntu 机器是一个干净的安装,上面几乎没有任何东西。

错误在这里:https://gist.github.com/tylermanning/6881ba664236e25434f8d0befd4a8bfc

系统信息:

  • 平台:ubuntu 18.04
  • 诗歌1.1.5版
  • 基础 Python:3.8.5
  • 基础 Python 的位置:/opt/anaconda/latest/bin/python

我是如何安装诗歌的:

  1. 卷曲-sSLhttps://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py |蟒蛇
  2. 来源,以便诗歌可以立即与source $HOME/.poetry/env一起使用
  3. 用像poetry new tes-proj这样的诗歌创建一个新项目
  4. test-proj目录内部启动poetry shell
  5. 尝试poetry showpoetry add [some package]会抛出错误

【问题讨论】:

  • 你需要一个锁文件才能让poetry show 工作,我想。运行poetry lock 或仅运行poetry install 能解决问题吗?
  • 这也可能与 conda 提供的 python 解释器有关。在我的测试中,我进行了源安装:gist.github.com/a-recknagel/dddfce44ffa8e6eacd5c06f64cfe0bb0
  • 谢谢,是的,我认为这是多种因素的结合。我找到了一个很快就会发布的解决方案。

标签: python ubuntu-18.04 python-poetry


【解决方案1】:

这个问题是 ubuntu 机器没有正确编码 locale 中的 utf-8。这是一个更深入的问题解释它:https://stackoverflow.com/a/57298412

解决方法是简单地将export PYTHONUTF8=1 添加到我的~/.bash_profile

【讨论】:

    猜你喜欢
    • 2022-09-24
    • 2021-06-13
    • 2021-04-24
    • 1970-01-01
    • 1970-01-01
    • 2022-07-22
    • 2015-06-21
    • 2020-09-07
    • 2022-06-24
    相关资源
    最近更新 更多