简体   繁体   English

Mac Yosemite Python

[英]Mac Yosemite Python

I am usually an R user for all my statistical analysis work, but I wanted to learn Python. 我通常是所有统计分析工作的R用户,但我想学习Python。 At the time I did not know that Python comes native to the Mac OS, so I went to python.org and installed Python 3.4.2 on my Mac. 当时我还不知道Python是Mac OS的本地版本,所以我去了python.org并在Mac上安装了Python 3.4.2。 This created a Python folder in my Applications from where I can access IDLE. 这在我的应用程序中创建了一个Python文件夹,从中可以访问IDLE。 For my purposes specifically, I also needed a few libraries, namely Pandas and Numpy. 具体来说,我还需要一些库,即Pandas和Numpy。 After some research I learnt that the best way to do this was to get Anaconda. 经过一番研究,我知道最好的方法就是购买Anaconda。

Hence, I went ahead and installed Anaconda for Python 3.4 from their website. 因此,我继续从他们的网站安装了适用于Python 3.4的Anaconda。 Now, the issue is, the Anaconda launcher came with its own IDE called Spyder and I found that this was much easier to use than IDLE, since it contained all the libraries I needed already. 现在,问题是,Anaconda启动器附带了自己的名为Spyder的IDE,我发现它比IDLE使用起来容易得多,因为它包含了我已经需要的所有库。 So this raised a couple of questions for me: 所以这给我提出了两个问题:

  1. Do I still need the Python 3.4 I installed from python.org? 我仍然需要从python.org安装的Python 3.4吗? If not, how can I remove this? 如果没有,该如何删除? I should mention that I'm not very familiar with how the Mac command line works, so if I could get instructions that have more detail, it would be easier for me 我应该提一下,我对Mac命令行的工作方式不是很熟悉,因此,如果我可以获得更详细的说明,对我来说会更容易

  2. Do I have 2 installs of Python 3.4 on my Mac now or did the Anacondas one replace the one from python.org? 我现在在Mac上安装了2次安装的Python 3.4,还是Anacondas取代了python.org的安装? If this is the case, can I just go ahead and delete the Python 3.4 folder in my Applications folder (which contains IDLE, etc.)? 如果是这种情况,我可以继续删除我的Applications文件夹中的Python 3.4文件夹(其中包含IDLE等)吗?

You now have three versions of Python on your Mac -- Anaconda will have installed itself into the directory anaconda in your home directory. 现在您的Mac上具有三个版本的Python-Anaconda将自己安装到主目录中的anaconda目录中。 You can remove the python.org install by following the instructions at: https://docs.python.org/3/using/mac.html?highlight=uninstall -- you may need to use the command line and rm command to remove files (for example, the symlink in /usr/local/bin/ ). 您可以按照以下网址上的说明删除python.org安装: https ://docs.python.org/3/using/mac.html?highlight=uninstall-您可能需要使用命令行和rm命令删除文件(例如, /usr/local/bin/的符号链接)。 Don't do this unless you're sure of what you're doing because they don't go to the Trash. 除非您确定自己在做什么,否则不要这样做,因为他们不会进入垃圾箱。

Important note: do not delete or modify the system-provided Python in /System/Library/Frameworks/Python.framework and /usr/bin/python or you will hose your operating system and need to reinstall Yosemite. 重要说明: 请勿/System/Library/Frameworks/Python.framework/usr/bin/python删除或修改系统提供的Python,否则您将安装操作系统并需要重新安装Yosemite。

If this all seems too scary, I would live with the bloat as long as anaconda is your default Python and you're happy with it. 如果这一切看起来都太吓人了,只要anaconda是您的默认Python,并且您对此感到满意,那么我会感到the肿。

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

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