简体   繁体   English

优胜美地上的Python

[英]Python on Yosemite

Just got a new Mac with Yosemite. 刚有了优胜美地的新Mac。 Ran the Migration Assistant to move files over from older machine. 运行“迁移助手”以将文件从较旧的计算机中移出。 Now I find myself with an "old" (2.7.2) version of Python that doesn't work on Yosemite (crash at second line of interactive command line). 现在,我发现自己使用的是“旧”(2.7.2)版本的Python,该版本在Yosemite上不起作用(在交互式命令行的第二行崩溃)。

Either Apple ships Yosemite with a really old version of Python, or MA decided to overwrite the one that was there with an older one from my old machine? 要么Apple用真正的旧版本的Python发行了Yosemite,要么MA决定用我的旧机器中的旧版本覆盖其中的那个版本?

Hoping that there is a way to solve this that doesn't involve multiple manual steps... but I haven't found an obvious way. 希望有一种解决方法,不涉及多个手动步骤...但是我还没有找到一种明显的方法。 Any Pythonistas out there that have a magic bullet for me? 有没有对我有神奇的子弹的Pythonista用户?

Also - is this the right forum for this question or should I move it to Ask Different (apple.stackexchange.com)? 另外-这是解决此问题的合适论坛,还是我应该将其移至Ask Different(apple.stackexchange.com)?

You undoubtedly had another version of Python installed, independent of the Apple-supplied system Pythons, which was migrated. 无疑,您已经安装了另一个版本的Python,该版本独立于Apple提供的系统Python进行了迁移。 If you used python.org installers, that Python would be in /Library/Frameworks . 如果您使用python.org安装程序,则该Python将位于/Library/Frameworks If you use a third-party package manager, like MacPorts or Homebrew, it is likely somewhere else. 如果使用MacPorts或Homebrew等第三方软件包管理器,则可能在其他地方。 You can use type python to find out where you are picking up Python from and then either upgrade it or remove it. 您可以使用type python来查找要从中拾取Python的位置,然后对其进行升级或删除。 Do not try to remove the Apple Pythons in /System/Library/Frameworks . 不要尝试在/System/Library/Frameworks删除Apple Python。 With Yosemite, Apple ships 2.7.6. 对于优胜美地,苹果公司发布了2.7.6。 You can either upgrade the additional Python, for example, by downloading and installing the latest Python 2 from python.org (currently 2.7.9), or follow the instructions here to remove it. 您可以升级其他Python,例如,通过从python.org(当前为2.7.9)下载并安装最新的Python 2,或按照此处的说明将其删除。

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

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