简体   繁体   English

在 MacOS 上安装和配置最新的 python 3.8 的问题

[英]Problem in installing and configuring latest python 3.8 on MacOS

I've been trying to install Python 3.8 on MacOS via homebrew but I ended up with many versions of Python.我一直在尝试通过自制软件在 MacOS 上安装 Python 3.8,但最终我得到了许多版本的 Python。

$ which python3
$ /Library/Frameworks/Python.framework/Versions/3.6/bin/python3

$ cd /Library/Frameworks/Python.framework/Versions
$ ls
$ 3.6   3.8

How do I fix it so that I get 3.8 to be the default python version?如何修复它以便将 3.8 设为默认的 Python 版本?

As far as I can tell, currently we are still working on moving to Python 3.8 (too many Homebrew formula dependencies and Jenkins CI often runs out of the disk space).据我所知,目前我们仍在努力迁移到 Python 3.8(太多的 Homebrew 公式依赖项和 Jenkins CI 经常耗尽磁盘空间)。

Here is mega issue tracker: Github python 3.8 migration issue .这是大型问题跟踪器: Github python 3.8 migration issue

For the time being, I would recommend to use pyenv , which I am using it to manage multiple python versions myself for development as well.目前,我建议使用pyenv ,我也使用它来管理多个 python 版本以进行开发。

Here is what you need to do:以下是您需要做的:

  • brew install pyenv
  • pyenv init
  • eval "$(pyenv init -)" # be sure echo 'eval "$(pyenv init -)"' > ~/.bash_profile for the future shell sessions. eval "$(pyenv init -)" # 确保为以后的 shell 会话echo 'eval "$(pyenv init -)"' > ~/.bash_profile
  • pyenv install 3.8.0
  • pyenv global 3.8.0

And then you are good to go.然后你就可以走了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM