Python 杂记

记录一些零碎命令。

卸载当前环境安装的所有包:

1
pip freeze | grep -v "^-e" | xargs pip uninstall -y

Conda 安装后,去掉命令行前面的环境名提示的方法:

.condarc 中做更改:

1
changeps1: False

或者,不要在 .bashrc 中激活 Conda :

~/.bashrc
1
# conda activate

更新 conda 自身:

1
conda update -n base -c defaults conda

References

What is the easiest way to remove all packages installed by pip?

Using the .condarc conda configuration file

Why does “(base)” appear in front of my terminal prompt?