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