[Python] When using venv, packages I'm building suddenly disappear when others are installed

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    This is more of a where in pip could this be happening, not a question about the repos/packages.

    I'm building several pytorch related repos using their setup.py scripts. For example, https://github.com/pytorch/vision/blob/main/setup.py.

    The setup.py of each should create the necessary files under /root/venv/lib/python3.10/site-packages, and they do. I see the folders post-build.

    However, I'm noticing some odd situation where packageA builds, shows under pip list, but then packageB builds and wipes out packageA from the list. The folder for packageA still exists under site-packages, which is the issue I need some help understanding.

    Here is the pip list showing xformers, while torchvision is still building:

    root@844722c6e751:~# pip list
    Package Version
    ------------ -------------------------
    bitsandbytes 0.45.2
    einops 0.8.1
    filelock 3.18.0
    fsspec 2025.3.0
    Jinja2 3.1.6
    MarkupSafe 3.0.2
    mpmath 1.3.0
    networkx 3.4.2
    pillow 11.1.0
    pip 22.0.2
    sympy 1.13.1
    torch 2.6.0
    xformers 0.0.30+1298453c.d20250326


    A second or two after torchvision finishes, the xformers disappears from the list.

    You can see the xformer folder is still there and looks complete too:

    root@fc2813de016d:~# ll wooly-client-venv/lib/python3.10/site-packages/
    total 396
    drwxr-xr-x 1 1000 1000 4096 Mar 26 15:34 ./
    drwxr-xr-x 1 1000 1000 4096 Mar 26 14:58 ../
    drwxr-xr-x 4 root root 4096 Mar 26 15:33 MarkupSafe-3.0.2-py3.10-linux-aarch64.egg/
    drwxr-xr-x 2 root root 4096 Mar 26 15:24 MarkupSafe-3.0.2.dist-info/
    drwxr-xr-x 2 root root 4096 Mar 26 14:58 PyYAML-6.0.2.dist-info/
    drwxr-xr-x 1 root root 4096 Mar 26 15:24 __pycache__/
    drwxr-xr-x 3 1000 1000 4096 Mar 26 14:58 _distutils_hack/
    drwxr-xr-x 3 root root 4096 Mar 26 14:58 _yaml/
    drwxr-xr-x 9 root root 4096 Mar 26 15:24 bitsandbytes/
    drwxr-xr-x 3 root root 4096 Mar 26 15:24 bitsandbytes-0.45.2.dist-info/
    -rw-r--r-- 1 1000 1000 152 Mar 26 14:58 distutils-precedence.pth
    -rw-r--r-- 1 root root 95 Mar 26 15:34 easy-install.pth
    drwxr-xr-x 3 root root 4096 Mar 26 15:24 filelock/
    . . .
    drwxr-xr-x 43 root root 4096 Mar 26 15:24 sympy/
    drwxr-xr-x 5 root root 4096 Mar 26 15:33 sympy-1.13.1-py3.10.egg/
    drwxr-xr-x 2 root root 4096 Mar 26 15:24 sympy-1.13.1.dist-info/
    drwxr-xr-x 63 root root 4096 Mar 26 15:24 torch/
    drwxr-xr-x 2 root root 4096 Mar 26 15:24 torch-2.6.0a0+gitd398019.egg-info/
    drwxr-xr-x 11 root root 4096 Mar 26 15:24 torchgen/
    drwxr-xr-x 4 root root 4096 Mar 26 15:34 torchvision-0.21.0+7af6987-py3.10-linux-aarch64.egg/
    drwxr-xr-x 3 root root 4096 Mar 26 14:58 typing_extensions-4.13.0.dist-info/
    -rw-r--r-- 1 root root 171956 Mar 26 14:58 typing_extensions.py
    drwxr-xr-x 5 root root 4096 Mar 26 14:58 wheel/
    drwxr-xr-x 2 root root 4096 Mar 26 14:58 wheel-0.45.1.dist-info/
    drwxr-xr-x 4 root root 4096 Mar 26 15:33 xformers-0.0.30+1298453c.d20250326-py3.10-linux-aarch64.egg/
    drwxr-xr-x 3 root root 4096 Mar 26 14:58 yaml/


    What could cause the packages to disappear after torchvision setup finishes if I don't see anything in the torchvision output/script that is removing packages from being visible under pip list (which would not show the package folder under site-packages)?

    Continue reading...

Compartilhe esta Página