Python 杂记

记录一些零碎命令。

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

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

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

使用 conda 禁用激活(由于未激活环境而不显示):

1
conda config --set auto_activate_base false

或者在 .condarc 中做更改(即使激活任意环境也不会显示):

1
changeps1: False

更新 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?

Mastodon