如何在Mac OS上安裝pytest、setuptools、wget
本文主要介紹如何在Mac OS上安裝pytest
,以自己實際安裝為例。
同時補充介紹了Mac OS上安裝setuptools
和Mac OS上安裝wget
的方法
Mac OS上安裝pytest
由於Mac OS上自帶python2.7,已是目標版本,不需要更新了,在此基礎上介紹安裝pytest的主要步驟:
- 安裝pip,在終端中輸入:
sudo easy_install pip
- 接著安裝pytest:
sudo pip install -U pytest
- 測試是否安裝成功:
py.test --version
在安裝過程中遇到了一些問題,主要問題有wget方法不能用
Mac OS上安裝setuptools
可以參考 https://pypi.python.org/pypi/setuptools
curl https://bootstrap.pypa.io/ez_setup.py -o - | python
也可以使用wget命令,但是需要mac os中有wget命令。
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
Mac OS上安裝wget:
一般使用軟件包管理器(package manager),自動download、compile、install,會自動尋找依賴關係的包然後自動安裝。
相關軟件包管理器有:
- homebrew(https://mxcl.github.com/homebrew/)
- MacPorts(https://www.macports.org/)等
安裝好homebrew或者MacPorts後,可以進行wget的安裝:
brew install wget
port install wget
最後更新:2017-07-04 17:02:30