简体   繁体   English

python 诗歌如何为所有用户安装ubuntu 18.04?

[英]python poetry how to install for all users ubuntu 18.04?

I am trying to install poetry for all users on ubuntu 18.04 and it doesn't seem to work.我正在尝试为 ubuntu 18.04 上的所有用户安装poetry ,但它似乎不起作用。

I have tried the script (which installs to a local user's home directory)我已经尝试过脚本(安装到本地用户的主目录)


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

and I've tried pip:我试过点子:


$ 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'

I also tried manually moving the poetry binary into /usr/local/bin but there are library dependencies that are not available.我还尝试手动将poetry二进制文件移动到/usr/local/bin中,但是有一些库依赖项不可用。

this is how I solved it:这就是我解决它的方法:


# 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/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM