有時候新增一個虛擬機 env 時候
avast 會把檔案放在沙盒執行
但是有時候檔案就回不來了

可能是權限問題
例如先刪除舊的
但是新的是在沙盒執行然後就沒有權限
然後我的 pip 就消失...

No module named 'pip'

google 找到一個方案

https://stackoverflow.com/questions/18363022/error-running-pip-install-importerror-no-module-named-pip

實測在 win10 有效

python -m ensurepip

然後就成功找回pip了

> python -m ensurepip
WARNING: Ignoring invalid distribution -ip (d:\env\p310_conv_llava\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\env\p310_conv_llava\lib\site-packages)
Looking in links: c:\Users\TEST\AppData\Local\Temp\tmprf47zzmp
Requirement already satisfied: setuptools in d:\env\p310_conv_llava\lib\site-packages (57.4.0)
Processing c:\users\TEST\appdata\local\temp\tmprf47zzmp\pip-21.2.3-py3-none-any.whl
WARNING: Ignoring invalid distribution -ip (d:\env\p310_conv_llava\lib\site-packages)
Installing collected packages: pip
WARNING: Ignoring invalid distribution -ip (d:\env\p310_conv_llava\lib\site-packages)
Successfully installed pip-21.2.3

PS D:\work\CT\RM\conv-llava> pip list info      
WARNING: Ignoring invalid distribution -ip (d:\env\p310_conv_llava\lib\site-packages)
Package    Version
---------- -------
pip        21.2.3
setuptools 57.4.0

給大家參考囉