Mac上的Python版本 [英] Python Versions on Mac

查看:97
本文介绍了Mac上的Python版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac Os 10.7(Lion),但我有一些问题:

I'm working on Mac Os 10.7 (Lion) and I have some questions:

  1. Lion上python的预安装版本是什么?
  2. 我已经在这台计算机上工作了一段时间,而且我已经安装了许多软件来完成大学工作很多次,但我实际上并不知道自己在做什么.问题是:现在,我在/Library/Frameworks/Python.framework/Versions/上有一个名为"7.0"的文件夹,我很确定没有python版本7.此文件夹是本机文件夹还是第三方程序安装.我可以删除它吗? (它在磁盘上使用的是1 Gb).
  3. mac os随附的原始python在哪里?
  4. 我选择Homebrew作为我的软件包管理器,是否有一种简单的方法来管理python版本?

推荐答案

  1. Lion默认使用Python 2.7; 2.5和2.6也可用.

  1. Lion uses Python 2.7 by default; 2.5 and 2.6 are also available.

/Library/Frameworks/Python.framework.我的猜测是,您最终通过安装一些应用程序来完成此操作.

/Library/Frameworks/Python.framework does not exist on a stock install of Lion. My guess is that you've ended up with this by installing some application.

默认的Python安装主要安装在/System/Library/Frameworks/Python.framework中,尽管某些组件位于其他位置.

The default Python install is primarily installed in /System/Library/Frameworks/Python.framework, although some components are located elsewhere.

是-您可以brew install python@2以获得与系统版本分开的Python 2.7,或brew install python以获得Python 3.7.像其他任何Homebrew食谱一样,两者都将安装到/usr/local.

Yes - you can brew install python@2 to get a Python 2.7 separate from the system version, or brew install python to get Python 3.7. Both will install to /usr/local, like any other Homebrew recipe.

这篇关于Mac上的Python版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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