简体   繁体   English

如何让 pip 知道删除 systemd 服务文件

[英]How do I let pip to know to remove the systemd service file

In my python package I offer the user to run as a service and then install a.service file.在我的 python package 中,我让用户作为服务运行,然后安装 a.service 文件。

Is there a way to let pip know to remove it if the package is uninstalled?如果 package 被卸载,有没有办法让 pip 知道将其删除?

Thank you谢谢

pip is not a full blown package manager, even less system package manager. pip不是一个成熟的 package 管理器,更不用说系统 package 管理器。 It doesn't support post-install or pre-uninstall scripts.它不支持安装后或卸载前脚本。

The 2 solutions for your problems are:您的问题的2个解决方案是:

  1. Include said service file in your wheels so pip uninstall removes it;在您的车轮中包含所述service文件,以便pip uninstall将其删除;

  2. Do not use pip at all, convert your package to rpm or deb .根本不要使用pip ,将 package 转换为rpmdeb

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

相关问题 默认情况下如何让pip install进入HOME? - How do I let pip install into HOME by default? 如何让pip知道我对python 3.4的软件包感兴趣? - How can I let pip know that I am interested in packages for python 3.4? pip install letencrypt,我如何知道需要哪些软件包? - pip install letencrypt, how do I know which packages are needed? Systemd服务文件中的dtach - dtach in systemd service file 如何从Raspbian上的systemd服务正确重定向stdout / stderr? - How do I properly redirect stdout/stderr from a systemd service on Raspbian? 如何使 systemd 服务使用 conda env through.sh 运行 python 项目 - how do I make systemd service to run python project with conda env through .sh 如何让用户在列表中添加或删除新项? - How do I let the user add or remove new items to the list? 我的 pip 安装在其他 PATH 中,我不想我不知道如何修改它 - My pip install in other PATH and I do not want I do not know how to modify it 我只能输入 1 个字母,如何让代码知道 2 个或更多字母也可以? - I only can type 1 letter , how do I let the code know that 2 or more letters are also okay? 如何在AWS实例上设置警报以在数据分析完成时通知我? - How do I set up alerts on AWS instances to let me know when my data analysis is complete?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM