将现有的Python库集成到Anaconda [英] Integrating exisiting Python Library to Anaconda
问题描述
我在Ubuntu上安装了很少的Python库/工具包,例如NLTK,SciPy和NumPy.我想尝试使用Anaconda发行版.我应该在安装Anaconda之前删除现有的库吗?
I've been installing few Library/Toolkit for Python like NLTK, SciPy and NumPy on my Ubuntu. I would like to try to use Anaconda distribution though. Should I remove my existing libraries before installing Anaconda?
推荐答案
无需删除系统Python.水蟒坐在旁边.安装后,它会在.bashrc
中添加一行,从而在PATH
中首先添加Anaconda目录.这意味着每当您在终端中键入python
或ipython
时,它将使用Anaconda Python(而Anaconda Python将自动使用所有的Anaconda Python库,例如numpy和scipy而不是系统库).您应该不理会系统Python,因为某些系统工具会使用它.要点是:
There is no need to remove your system Python. Anaconda sits alongside it. When it installs, it adds a line to your .bashrc
that adds the Anaconda directory first in your PATH
. This means that whenever you type python
or ipython
in the terminal, it will use the Anaconda Python (and the Anaconda Python will automatically use all the Anaconda Python libraries like numpy and scipy rather than the system ones). You should leave the system Python alone, as some system tools use it. The important points are:
-
PATH
中的哪个Python首先是在终端中使用Python时使用的内容.如果使用conda
创建conda环境并使用source activate
,它将首先将该环境放在PATH
上. - 每个Python(Anaconda或系统)将使用其自己的库,而不查看其他库(如果设置了
PYTHONPATH
环境变量,则不然,但我建议您不要使用).
- Whichever Python is first on your
PATH
is what gets used when you use Python in the terminal. If you create a conda environment withconda
and usesource activate
it will put that environment first on thePATH
. - Each Python (Anaconda or the system) will use its own libraries and not look at the others (this is not true if you set the
PYTHONPATH
environment variable, but I recommend that you don't).
这篇关于将现有的Python库集成到Anaconda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!