gpt4 book ai didi

python-3.x - python 诗歌如何为所有用户安装ubuntu 18.04?

转载 作者:行者123 更新时间:2023-12-04 18:47:58 33 4
gpt4 key购买 nike

我正在尝试安装 poetry对于 ubuntu 18.04 上的所有用户,它似乎不起作用。
我已经尝试过脚本(安装到本地用户的主目录)


$ curl -sSL https://install.python-poetry.org | python3 -
# this works but is only installed for the current user

我试过点子:

$ pip install poetry
$ poetry
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 28, in <module>
from CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in <module>
from CommandNotFound.db.db import SqliteDatabase
File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

我还尝试手动移动 poetry二进制到 /usr/local/bin但是有一些库依赖项不可用。

最佳答案

这就是我解决它的方法:


# copy poetry bin and lib to /usr/local/bin and /usr/local/lib
$ cd ~/.local/lib/python3.8/site-packages
$ sudo cp -R ./poetry-1.1.13.dist-info/ /usr/local/lib/python3.8/dist-packages/
$ sudo cp -R ./poetry_core-1.0.8.dist-info/ /usr/local/lib/python3.8/dist-packages/
$ sudo cp -a . /usr/local/lib/python3.8/dist-packages/
$ cd ~/.local/bin
$ sudo cp poetry /usr/local/bin/
$ sudo chmod -R 775 /usr/local/lib/python3.8/dist-packages/

关于python-3.x - python 诗歌如何为所有用户安装ubuntu 18.04?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72520712/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com