pip用命令更新所有包
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
vboxapi的pip打印错误
Downloading/unpacking vboxapi
Could not find any downloads that satisfy the requirement vboxapi
Some externally hosted files were ignored (use --allow-external vboxapi to allow).
Some insecure and unverifiable files were ignored (use --allow-unverified vboxapi to allow).
Cleaning up...
No distributions at all found for vboxapi
Storing debug log for failure in /Users/rmuhamedgaliev/.pip/pip.log
我可以说pip在更新时忽略vboxapi吗?
我试过命令
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U -I
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U -I --allow-external vboxapi
解决方法:
是的,您可以忽略这样的vboxapi包.
grep -Pv '^(?:\-e|vboxapi\=)'
> -P标志告诉grep使用perl兼容的正则表达式.
> -v标志表示只列出与后面的正则表达式不匹配的那些.
>正则表达式匹配以-e或vboxapi =开头的行
您想要完成的完整示例:
pip freeze --local | grep -Pv '^(?:\-e|vboxapi\=)' | cut -d = -f 1 | xargs -n1 pip install -U;