Linux+Eclipse+Pydev

来源:互联网 发布:太原公交查询软件 编辑:程序博客网 时间:2024/06/11 13:17

在Elipse里安装python有两种方式,一种是在先安装,但现在很多地址源都无法使用了,如下例:

http://rwg109.iteye.com/blog/836556

另一种方式就是自己手动下载pydev安装包,安装配置方法如下面转载文字所示:

 

1、下载
org.python.pydev.feature-1.4.6.2788-sources.zip
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 => preferences => 点击左边的pydev => 单击interpreter-Python
=> 点击右边的new =>填好name(我这里填python)和executable路径(我这里填写我的python执行路径:/usr/bin/python)
===================================完毕=================================
注意:在第5步中,一定要设置好。如果没有设置好,会在你新建python工程的时候出现Project interpreter not specified错误提示。



注意事项:

1. Java 7 (If you don't have java 7, the update process may appear to succeed,


 but PyDev will simply not show in the target installation. Please double-



check if you're using a java 7 vm in about > installation details > 


configuration before trying to install PyDev).



2. An alternative is just getting the zip file and extracting it yourself in 


eclipse.

For Eclipse 3.4 onwards, you can extract it in the 'dropins' folder (and 

restart Eclipse).

For Eclipse 3.2 and 3.3, you have to make sure the plugins folder is 

extracted on top of the Eclipse plugins folder and restart with '-clean'.