在尝试在 linux 机器上安装 AWS SAM CLI 时,我必须安装 Homebrew/Linuxbrew。AWS 软件包依赖于我已经在我的系统上安装的 python 3。在自制软件安装日志的中间,我看到了这个:
==> Pouring python-3.7.4.x86_64_linux.bottle.tar.gz
==> /home/linuxbrew/.linuxbrew/Cellar/python/3.7.4/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/home/linuxbrew/.linuxbrew/Cellar/python/3.7.4
==> /home/linuxbrew/.linuxbrew/Cellar/python/3.7.4/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/home/linuxbrew/.linuxbrew/Cellar/python/3.7.4
==> /home/linuxbrew/.linuxbrew/Cellar/python/3.7.4/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/home/linuxbrew/.linuxbrew/Cellar/python/3.7.4
==> Caveats
Python has been installed as
/home/linuxbrew/.linuxbrew/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/home/linuxbrew/.linuxbrew/opt/python/libexec/bin
接下来是:
$ which python3
/home/linuxbrew/.linuxbrew/bin/python3
这对我来说并不好,因为它之前没有警告过,让我别无选择,而且我比自制软件更信任我的发行版。
我的第一个想法是删除包:
$ brew uninstall python3
Error: Refusing to uninstall /home/linuxbrew/.linuxbrew/Cellar/python/3.7.4
because it is required by aws-sam-cli, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python3
这意味着我不能简单地删除它
现在,安装依赖项是可以忍受的,但如果它替换我的系统本机包则不行,所以我的问题是:
有没有办法告诉自制软件将来不要弄乱我的系统,并取回我的原生 python ?