在 Mac OS X 上安装了 Python 3 但它仍然是 Python 2.7 [英] Installed Python 3 on Mac OS X but its still Python 2.7

查看:147
本文介绍了在 Mac OS X 上安装了 Python 3 但它仍然是 Python 2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的 MacBook Pro 上运行 OS X Yosemite (10.10.2)...默认情况下,Apple 在 Yosemite 上提供 Python 2.7.6.

I am currently running OS X Yosemite (10.10.2) on my MacBook Pro... By default, Apple ships Python 2.7.6 on Yosemite.

刚刚为 Python 3 下载并运行了这个安装程序:python-3.4.3-macosx10.6.pkg

Just downloaded and ran this installer for Python 3: python-3.4.3-macosx10.6.pkg

当我打开终端并输入 python 时,结果如下:

When I opened up my Terminal and typed in python, this is what came up:

Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

问题:

  1. 有人知道 Python 3.4.3 解释器的安装位置吗?
  2. 在将全局环境变量(例如 PYTHON_HOME)设置为已安装 Python 3.4.3 的位置之前,我是否需要卸载 Python 2.7.3(如果是,我该怎么做)?

推荐答案

尝试输入 python3 而不是 python.

Try typing python3 instead of just python.

这篇关于在 Mac OS X 上安装了 Python 3 但它仍然是 Python 2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆