600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 用homebrew 升级安装python3.7 之后系统的python版本还是旧的怎么办

用homebrew 升级安装python3.7 之后系统的python版本还是旧的怎么办

时间:2019-07-28 13:31:28

相关推荐

用homebrew 升级安装python3.7 之后系统的python版本还是旧的怎么办

mac 中安装了多个版本的python$ brew install python3

Updating Homebrew...Warning: python 3.7.1 is already installed, it's just not linkedYou can use `brew link python` to link this version.#brew 提示已经安装了 3.7.1但是系统变量里检测不到 并提示用 `brew link python` 来链接$ brew link pythonLinking /usr/local/Cellar/python/3.7.1... Error: Could not symlink bin/2to3Target /usr/local/bin/2to3already exists. You may want to remove it:rm '/usr/local/bin/2to3'To force the link and overwrite all conflicting files:brew link --overwrite pythonTo list all files that would be deleted:brew link --overwrite --dry-run python#链接错误 提示有 /usr/local/bin/2to3 需要删除然后重写$ brew link --overwrite pythonLinking /usr/local/Cellar/python/3.7.1... 24 symlinks created#成功之后 查看版本。。$ python3 --versionPython 3.6.5$python --versionPython 3.6.4 :: Anaconda, Inc.

两种的命令显示的版本不一样。由于之前安装了anaconda,anaconda 之前用的版本python指定了3.6.4,和anaconda绑定的。

现在用brew安装了之后并没有链接到系统变量。之后又用安装包的格式下载了 python 3.7.1然后$ python3 --versionPython 3.7.1可见通过官方安装包安装的会自动注册环境变量经过验证凡是通过安装包安装的都会在下面的目录下:/Library/Frameworks/Python.framework/Versions/3.4/Library/Frameworks/Python.framework/Versions/3.6/Library/Frameworks/Python.framework/Versions/3.7通过brew 安装的都会在/usr/local/Cellar/python/3.7.1并且在子目录中/usr/local/Cellar/python/3.7.1/Python\ Launcher\ 3.app idle 3 和 Python Launcher

综上,尽量用官方网站提供的安装包,不用做额外的操作,制动链接系统变量

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。