1. 程式人生 > >使用conda安裝Python第三方工具包

使用conda安裝Python第三方工具包

最近在學習Zipline框架,在安裝的過程中遇到了一些問題,簡單記錄如下
個人開發環境:Anaconda(純淨的Python2.7,這個一直沒用過)
嘗試用之前的pip,沒有成功。後來在網上查到了conda指令

一、Intro to conda

Package, dependency and environment management for any language: Python, R, Scala, Java, Javascript, C/ C++, FORTRAN

conda提供了對包、依賴、開發環境的管理,支援Python、Java、c++等多種語言

Conda is a package manager application that quickly installs, runs, and updates packages and their dependencies. The conda command is the primary interface for managing installations of various packages. It can query and search the package index and current installation, create new environments, and install and update packages into existing conda environments. See our Using conda section for more information.

Conda is also an environment manager application. A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected. You can easily activate or deactivate (switch between) these environments. You can also share your environment with someone by giving them a copy of your environment.yaml file.

上文中,大概提到了第三方包的安裝、更新、解除安裝,顯示安裝包目錄等等。但是關於環境管理挺不好理解的:

  1. 執行不同的Python程式,需要使用不同版本的Python(2.x或3.x)(對不同的Python專案,我們可以實現開發環境的隔離)
    在同一中Python版本中,可能需要用到不同版本的第三方包,例如:Django 1.6或者Django 1.7
  2. 這也解牽涉到了所謂的虛擬環境,在Python中,conda指令可以對虛擬環境進行有效的控制,安裝、克隆、切換、刪除等等

what is difference between pip and conda?

  1. 既然都是關於python的包管理工具為什麼有了pip 我們還需要conda?我們來看看stackoverflow上的解答
  2. 我直接附上網站吧,需要的同學直接去看原味的解釋