天天看點

安裝pydev到eclipse

剛剛接觸python,寫的代碼的時候都是用vi,感覺效率不高,就google一下,發現有很多python的IDE,很多人用的是elclips的pydev這個插件。下面我就安裝一下它:

1、下載下傳

<a href="http://sourceforge.net/projects/pydev/files/pydev/org.python.pydev.feature-1.4.6.2788-sources.zip">org.python.pydev.feature-1.4.6.2788-sources.zip</a>

2、解壓

[yorks@localhost Software]$ mkdir pydev

[yorks@localhost Software]$ cd pydev/

[yorks@localhost pydev]$ ls

org.python.pydev.feature-1.4.6.2788-sources.zip

[yorks@localhost pydev]$ unzip org.python.pydev.feature-1.4.6.2788-sources.zip

features  org.python.pydev.feature-1.4.6.2788-sources.zip  plugins

3、檢視安裝的eclips的plugins和features目錄在哪裡。

[yorks@localhost pydev]$ whereis eclipse

eclipse: /usr/share/eclipse

[yorks@localhost pydev]$ ls -l /usr/share/eclipse/

總計 416

drwxr-sr-x  2 root root   4096 06-29 15:03 about_files

-rw-r--r--  1 root root  13852 2008-09-23 about.html

-rw-r--r--  1 root root  39292 2008-09-23 artifacts.xml

drwxr-sr-x  5 root root   4096 06-29 15:03 configuration

drwxr-sr-x  2 root root   4096 2008-09-23 dropins

-rwxr-xr-x  1 root root  19475 2008-10-31 eclipse

-rw-r--r--  1 root root    113 2008-09-23 eclipse.ini

-rw-r--r--  1 root root  16536 2008-09-23 epl-v10.html

drwxr-sr-x 20 root root   4096 07-05 13:24 features

-rwxr-xr-x  1 root root 263000 2008-10-31 libcairo-swt.so

-rw-r--r--  1 root root   6506 2008-09-23 notice.html

drwxr-sr-x  5 root root   4096 06-29 15:03 p2

drwxr-sr-x 22 root root  20480 07-05 13:25 plugins

drwxr-sr-x  2 root root   4096 06-29 15:04 readme

通過檢視知道features和plugins的目錄在/usr/share/eclipse目錄下。

4、将pydev的features和plugins目錄下的所有東西mv到/usr/share/eclipse/對應的目錄下。

[yorks@localhost pydev]$ mv features/* /usr/share/eclipse/features/

[yorks@localhost pydev]$ mv plugins/* /usr/share/eclipse/plugins/

5、啟動eclipse,設定pydev的環境。

Window =&gt; preferences =&gt; 點選左邊的pydev =&gt; 單擊interpreter-Python

=&gt; 點選右邊的new =&gt;填好name(我這裡填python)和executable路徑(我這裡填寫我的python執行路徑:/usr/bin/python)

===================================完畢=================================

注意:在第5步中,一定要設定好。如果沒有設定好,會在你建立python工程的時候出現Project interpreter not specified錯誤提示。

繼續閱讀