2013年3月29日 星期五

在Windows 64 bit 上安裝 pip

張貼者: aiko 晚上10:33
謝謝阿宅寶帶我去 Taipei.py 晃晃
雖然說聽完第一個分享之後
我就因為都聽不懂而感到無聊開始玩 candy crush
回來之後想說還是來學學 python 好了



一開始就是我最討厭的安裝環境
每次都讓我很想哭
但這種事不自己做就永遠學不到

整體來說裝的還算順利
只是裝完 easy_install 之後 pip 裝不起來 哭哭
然後我就懊惱地去吃飯了(噢其實還去看了裁縫機)

回來之後靠強大的 stackoverflow 救了我
原來又是 64 bit 惹的禍

一位名為 AndrewPK 的先生說: 因為 ez_setup 的關係
64bit windows + python 需要用分開的方法安裝 pip
以下是步驟
  1. 下載 distribute (將這檔案另存在 C:\Python27\Scripts)
  2. 打開 cmd,切換到剛剛下載的資料夾:cd /d c:\\Python27\Scripts 
  3. 輸入指令:python distribute_setup.py
    (要把 python 的安裝目錄放到環境變數 PATH 底下才能執行這個指令噢)
  4. 把 C:\Python27\Scripts 也加到環境變數PATH底下,同時在這個目錄底下執行指令
     easy_install pip
好啦其實我也只是將英文翻成中文
以下為其原文與出處

For Windows editions of the 64 bit variety - 64bit windows + python used to require a separate installation method due to ez_setup, but I've tested the new distribute method on 64bit windows running 32bit python and 64bit python, and you can now use the same method for all versions of windows/python 2.7X:
New Method using distribute:
  1. Download distribute - I threw mine in C:\Python27\Scripts (feel free to create a Scripts directory if it doesn't exist.
  2. Open up a command prompt (on windows you should check out conemu2 if you don't use powershell) and CD to the directory you've downloaded distribute_setup.py to.
  3. Run distribute_setup: python distribute_setup.py (This will not work if your python installation directory is not added to your path - go here for help)
  4. Change the current directory to the Scripts directory for your python installation (C:\Python27\Scripts) or add that directory, as well as the python base installation directory to your %PATH% environment variable.
  5. Install pip using the newly installed setuptools: easy_install pip
The last step will not work unless you're either in the directory easy_install.exe is located in(C:\Python27\Scripts would be the default for python 2.7), or you have that directory added to your path.
原文出處
只是因為這個解答沒有被選為正解,所以要往下找一下才看的到哦~

後記: 阿宅寶居然迅速的在 64 bit windows 上裝好了 pip
分享一下他裝的方式:
  1. 先裝 python
  2. 下載 ez_setup
  3. 下載 pip 包
  4. 執行 python setup.py install
然後就好了

為什麼電腦都比較聽宅男的話.... 不公平...T_T

0 意見:

張貼留言

 

La vie en rose. Template by Ipietoon Blogger Template | Gadget Review