推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
dwzhao
V2EX  ›  Python

pip 包经常被无缘无故的被删除,如何找出原因?

  •  
  •   dwzhao · Aug 5, 2020 · 3762 views
    This topic created in 2281 days ago, the information mentioned may be changed or developed.
    pip 包经常被无缘无故的被删除,初步估计应该不是人为操作,想要找到原因。

    思路 1:增加 log,但是没有想到
    看了下 pip 中提供了一个 log,但是这个 log 只有操作失败才记录,所以没法使用。
    --log-file <path>
    Path to a verbose non-appending log, that only logs failures. This log is active by default at <see File logging>.
    14 replies  •  2020-08-18 10:54:43 +08:00
    ruanimal
    ruanimal
    Aug 5, 2020
    1
    信息太少,没法判断
    crystom
    crystom
    Aug 5, 2020
    2
    encro
    encro
    Aug 5, 2020
    3
    通常是因为存在多个 Python 版本,比如:
    Python3+Python2
    系统 python + virtualenv python
    redhat 的 SCL
    lxk11153
    lxk11153
    Aug 5, 2020
    4
    我昨天安装过一个 Package,还用过,今天用发现没了,不知道是不是文件被删了,反正用不了,重新安装了
    dwzhao
    dwzhao
    OP
    Aug 5, 2020
    5
    @lxk11153,最近不断被删除,每次手动装太麻烦,难
    dwzhao
    dwzhao
    OP
    Aug 5, 2020
    6
    @ruanimal,就是 pip 包无缘由的被删除了,想要定位到原因,但是 pip 的没有 log,所有问问大家有推荐方法没
    Hopetree
    Hopetree
    Aug 5, 2020
    7
    虚拟环境了解一下
    Vegetable
    Vegetable
    Aug 5, 2020
    8
    信息太少了吧
    你用的什么用户? site-packages 在什么文件夹?有没有使用虚拟环境?所谓“被删除”的症状是什么,确认是存在的文件消失了吗?第二次安装缓存还在吗?
    dwzhao
    dwzhao
    OP
    Aug 5, 2020
    9
    @Hopetree,哈哈,理论上是应该分离的,只是这个是老项目了,拆起来觉得麻烦。不想动
    dwzhao
    dwzhao
    OP
    Aug 5, 2020
    10
    @Vegetable,提供了一个 oper 用户,没有虚拟环境,被删除就是包被 uninstall 了, 缓存还在
    kerwincsc
    kerwincsc
    Aug 5, 2020
    11
    静待解决方案
    ruanimal
    ruanimal
    Aug 5, 2020
    12
    你用的啥系统?系统什么版本? python 什么版本?用的是系统 python 吗?是不是有其他用户?
    kerwincsc
    kerwincsc
    Aug 5, 2020
    13
    1. yum install inotify-tools -y
    2. inotifywait -m --timefmt "%H:%M:%s" --format "%T %w %f %e" <python-package-dir>
    像平时一样使用 python, 看看是否有变化
    @dwzhao
    dwzhao
    dwzhao
    OP
    Aug 18, 2020
    14
    自己用 pyinotify 找了下信息的上下文,找到原因了,原来被其他人的 Jenkins 更新删了。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3191 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 10:44 · PVG 18:44 · LAX 02:44 · JFK 05:44
    ♥ Do have faith in what you're doing.