顯示具有 python 標籤的文章。 顯示所有文章
顯示具有 python 標籤的文章。 顯示所有文章

2013年1月3日 星期四

升級到OSX 10.8 (Mountain Lion)後,pip使用遇到問題

升級之後,使用pip安裝套件,卻出現下面這種狀況。
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in 
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in 
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: pip==1.1
這時候要做的事情很容易,只需要把pip做升級,就可以解決這個問題。
sudo easy_install -U pip
Reference: stackoverflow

2012年2月28日 星期二

Mac上使用pip安裝httpie

使用pip安裝Python package非常簡單,只要以下步驟:
# 安裝pip
sudo easy_install pip

# 安裝httpie
sudo pip install httpie
Reference: Python Guide

2011年2月21日 星期一

Install Python 2.6 on CentOS

sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
sudo wget http://dagobah.ftphosting.net/yum/smartfile.repo -O /etc/yum.repos.d/smartfile.repo
yum list *python26*
yum install -y python26 python26-devel
Reference: argustus