2014-04-22

Python 安裝 SetupTools(easy_install, pip)


1. 首先到這裡(ez_setup.py)下載 ez_setup.py
2. 執行以下指令
#wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python

如果你遇到
ERROR: cannot verify bitbucket.org's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV CA-1':
  Unable to locally verify the issuer's authority.
To connect to bitbucket.org insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.


則表示你的系統不支援驗證 SSL, 請依指示加上參數--no-check-certificate



改成以下
#wget --no-check-certificate https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python  

3. 下好了 ez_setup.py  後, 執行以下指令安裝
#python ez_setup.py install

不支援 SSL 的請用以下指令安裝,
#python ez_setup.py --insecure install

 以避免遇到以下的錯誤發生
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz
Traceback (most recent call last):
  File "./ez_setup.py", line 361, in <module>
    sys.exit(main())
  File "./ez_setup.py", line 357, in main
    downloader_factory=options.downloader_factory)
  File "./ez_setup.py", line 282, in download_setuptools
    downloader(url, saveto)
  File "./ez_setup.py", line 189, in download_file_curl
    _clean_check(cmd, target)
  File "./ez_setup.py", line 152, in _clean_check
    subprocess.check_call(cmd)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['curl', 'https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz', '--silent', '--output', '/home/yonyou/setuptools-2.1.tar.gz']' returned non-zero exit status 60



 4. 安裝 pip 
# python  ez_setup.py pip


 

沒有留言:

張貼留言