Can't create python project in eclim

214 views
Skip to first unread message

Petr Sobotka

unread,
Jan 19, 2012, 11:39:49 AM1/19/12
to eclim...@googlegroups.com
Hello,

I re-install eclim with python support, but when I try to create python project I receive following error message:

java.lang.IllegalArgumentException: Unable to find nature for alias 'python'. S
upported aliases include: cpp=org.eclipse.cdt.core.ccnature, c=org.eclipse.cdt.c
ore.cnature, c++=org.eclipse.cdt.core.ccnature, java=org.eclipse.jdt.core.javana
ture
while executing command (port: 9092): -command project_create -f "~/pythonproject/" -n python

I have vim compiled with python3 support and I installed rope for python 3. 

Here is output of :version command in vim:
:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 19 2012 16:38:31)
Included patches: 1-401
Compiled by kf...@localhost.localdomain
Normal version with GTK2 GUI. Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl
+cmdline_hist +cmdline_info +comments -conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs
+dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer +fork()
+gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds
+localmap -lua +menu +mksession +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm
-mouse_sysmouse +mouse_xterm -mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl
+persistent_undo +postscript +printer -profile -python +python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
+terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/i
nclude/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/in
clude/freetype2 -I/usr/include/libpng12 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/lib -L/usr/local/lib -Wl,--as-needed -o vim -L/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf
-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp
-lSM -lICE -lm -lncurses -lnsl -lselinux -L/usr/local/lib/python3.2/config-3.2m -lpython3.2m -lpthread -ldl -lutil
-lm

Any idea what I'm doing bad or where I should look for python problems? 

--
Cheers,
Petr Sobotka aka Pietro

P.S.: Thanks a lot for eclim, it's great!

Petr Sobotka

unread,
Jan 19, 2012, 12:03:07 PM1/19/12
to eclim...@googlegroups.com
Hello,

I found out that to create python project, 'none' has to be used as nature of project.
And I had to compile vim with python 2.* support not only python3. 

It looks like rope is used only form python 2 site-packages ... 
Does it mean that eclim doesn't support projects in python 3? 

--
Cheers,
Petr Sobotka aka Pietro

2012/1/19 Petr Sobotka <sobo...@gmail.com>

Eric Van Dewoestine

unread,
Jan 20, 2012, 6:01:25 PM1/20/12
to eclim...@googlegroups.com
On 2012-01-19 18:03:07, Petr Sobotka wrote:
> Hello,
>
> I found out that to create python project, 'none' has to be used as nature
> of project.
> And I had to compile vim with python 2.* support not only python3.
>
> It looks like rope is used only form python 2 site-packages ...
> Does it mean that eclim doesn't support projects in python 3?
>
> --
> Cheers,
> Petr Sobotka aka Pietro

Currently eclim relies on embedded python code in vim calling out to
rope or the python compiler for most of the python features (code
completion, searching, validation). Getting that code to work for both
python 2.x and python 3 would pretty gross. I plan to instead invest
that time into moving to the use of pydev instead which should support
switching python versions must better. But, since I don't think I'll
get around to that any time soon I went ahead and created a separate
eclim branch (python3[1]) which converts the code to use rope_py3k and
updates all the embedding vim code to be python 3 compatible. It all
seems to work well in my testing, but give it a shot and let me know
if you run into any problems.

[1] https://github.com/ervandew/eclim/compare/python3

--
eric

Petr Sobotka

unread,
Jan 24, 2012, 1:11:50 PM1/24/12
to eclim...@googlegroups.com
Hi Eric,

Thanks for quick reply.

If I have vim compiled with python and python3, I get following error:

Error detected while processing function eclim#python#validate#Validate..eclim#python#validate#ValidateSyntax:
line 14:
E837: This Vim cannot execute :py3 after using :python
E263: Sorry, this command is disabled, the Python library could not be loaded.
Error detected while processing function eclim#python#validate#Validate..eclim#python#rope#Validate..eclim#python#rope#Ini
t:
line 126:
E837: This Vim cannot execute :py3 after using :python
E263: Sorry, this command is disabled, the Python library could not be loaded.
Error detected while processing function eclim#python#validate#Validate..eclim#python#rope#Validate:
line 20:
E837: This Vim cannot execute :py3 after using :python
E263: Sorry, this command is disabled, the Python library could not be loaded.

When I compile vim with only python3 support I get this:
This functionality requires 'python' support compiled into vim

When I change checking of support of python, it works! ;-)

Here is diff:
git diff
diff --git a/org.eclim.python/vim/eclim/autoload/eclim/python/rope.vim b/org.ecl
index 13eefd1..fc2d6ab 100644
--- a/org.eclim.python/vim/eclim/autoload/eclim/python/rope.vim
+++ b/org.eclim.python/vim/eclim/autoload/eclim/python/rope.vim
@@ -24,7 +24,7 @@

" Init(project) {{{
function! eclim#python#rope#Init(project)
- if !has('python')
+ if !has('python3')
call eclim#util#EchoError(
\ "This functionality requires 'python' support compiled into vim.")
return 0


--
Cheers,
Petr Sobotka aka Pietro

2012/1/21 Eric Van Dewoestine <erva...@gmail.com>

--
eric

--
You received this message because you are subscribed to the Google Groups "eclim-user" group.
To post to this group, send email to eclim...@googlegroups.com.
To unsubscribe from this group, send email to eclim-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/eclim-user?hl=en.




Eric Van Dewoestine

unread,
Jan 25, 2012, 10:30:54 AM1/25/12
to eclim...@googlegroups.com

Thanks for the update. I just checked in a change to that branch which
flips both the rope.vim and the validate.vim has() checks to look for
python3 instead of python.

--
eric

Reply all
Reply to author
Forward
0 new messages