YouCompleteMe fails because of an ImportError: cannot import name 'urljoin'

Created on 24 Mar 2017  路  5Comments  路  Source: ycm-core/YouCompleteMe

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:

  • [ x] I have read and understood YCM's CONTRIBUTING document.
  • [ x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [ x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [ x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x ] If filing a bug report, I have included the output of vim --version.
  • [ ] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [ ] If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • [ x] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [ ] If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • [ ] If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • [x ] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x ] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

Since recently I can no longer use YouCompleteMe on Windows 10 with Vim 8. I get the following import error
ImportError: cannot import name 'urljoin'

I suppose this is related to this pull request https://github.com/Valloric/YouCompleteMe/pull/2578
Before this pull request I didn't have this problem.

:messages

Here is the complete messages command output

Traceback (most recent call last):
File "", line 24, in
File "C:\Users\christian\vimfiles\bundle\YouCompleteMe\autoload..python\ycm\setup.py", line 47, in SetUpYCM
from ycm.youcompleteme import YouCompleteMe
File "C:\Users\christian\vimfiles\bundle\YouCompleteMe\autoload..python\ycm\youcompleteme.py", line 41, in
from ycm.omni_completer import OmniCompleter
File "C:\Users\christian\vimfiles\bundle\YouCompleteMe\autoload..python\ycm\omni_completer.py", line 29, in
from ycm.client.base_request import BaseRequest, HandleServerException
File "C:\Users\christian\vimfiles\bundle\YouCompleteMe\autoload..python\ycm\client\base_request.py", line 31, in
from ycmd.utils import ToBytes, urljoin, urlparse
ImportError: cannot import name 'urljoin'
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 21 2017 23:08:51)

Test import urljoin from within GVim

:python3 << EOF
from urllib.parse import urljoin
print(urljoin('http://test.com', 'foo'))
EOF
http://test.com/foo

As you can see I am able to import urljoin from urlbase from within GVim without a problem.
I really don't understand why urljoin wasn't imported by ycmd module.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 21 2017 23:08:51)
MS-Windows 32 Bit GUI Version mit OLE-Unterst眉tzung
Inklusive der Korrekturen: 1-502
脺bersetzt von appveyor@APPVYR-WIN
Riesige Version mit GUI. Ein- (+) oder ausschlie脽lich (-) der Eigenschaften:
+acl +cryptv +find_in_path +listcmds +perl/dyn -sun_workshop +visual
+arabic +cscope +float +localmap +persistent_undo +syntax +visualextra
+autocmd +cursorbind +folding +lua/dyn -postscript +tag_binary +viminfo
+balloon_eval +cursorshape -footer +menu +printer +tag_old_static +vreplace
+browse +dialog_con_gui +gettext/dyn +mksession +profile -tag_any_white +wildignore
++builtin_terms +diff -hangul_input +modify_fname +python/dyn +tcl/dyn +wildmenu
+byte_offset +digraphs +iconv/dyn +mouse +python3/dyn -termguicolors +windows
+channel +directx +insert_expand +mouseshape +quickfix -tgetent +writebackup
+cindent -dnd +job +multi_byte_ime/dyn +reltime -termresponse -xfontset
+clientserver -ebcdic +jumplist +multi_lang +rightleft +textobjects -xim
+clipboard +emacs_tags +keymap +mzscheme/dyn +ruby/dyn +timers +xpm_w32
+cmdline_compl +eval +lambda +netbeans_intg +scrollbind +title -xterm_save
+cmdline_hist +ex_extra +langmap +num64 +signs +toolbar
+cmdline_info +extra_search +libcall +ole +smartindent +user_commands
+comments +farsi +linebreak +packages +startuptime +vertsplit
+conceal +file_in_path +lispindent +path_extra +statusline +virtualedit
System-vimrc-Datei: "$VIM\vimrc"
Benutzer-vimrc-Datei: "$HOME_vimrc"
zweite Benutzer-vimrc-Datei: "$HOME\vimfiles\vimrc"
dritte Benutzer-vimrc-Datei: "$VIM_vimrc"
Benutzer-exrc-Datei: "$HOME_exrc"
zweite Benutzer-exrc-Datei: "$VIM_exrc"
System-gvimrc-Datei: "$VIM\gvimrc"
Benutzer-gvimrc-Datei: "$HOME_gvimrc"
zweite Benutzer-gvimrc-Datei: "$HOME\vimfiles\gvimrc"
dritte Benutzer-gvimrc-Datei: "$VIM_gvimrc"
defaults file: "$VIMRUNTIME\defaults.vim"
System-Men眉-Datei: "$VIMRUNTIME\menu.vim"
脺bersetzt: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL -DFEAT_XPM_W32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 /Fo.\ObjGXOULYHTRZi386/ /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_MBYTE -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python35.dll\" -DFEAT_MZSCHEME -I "C:\Program Files (x86)\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a0solc.dll\" -DDYNAMIC_MZGC_DLL=\"libracket3m_a0solc.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl524.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=22 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby220.dll\" -DFEAT_HUGE /Fd.\ObjGXOULYHTRZi386/ /Zi
Linken: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 gdi32.lib version.lib winspool.lib comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib /nodefaultlib:lua53.lib /STACK:8388608 /nodefaultlib:python27.lib /nodefaultlib:python35.lib "C:\Tcl\lib\tclstub86.lib" WSock32.lib xpmx86\lib\libXpm.lib /PDB:gvim.pdb -debug

Output of YcmDebugInfo

Place the output here, or a link to a gist.

Contents of YCM, ycmd and completion engine logfiles

Include link here to a gist containing the entire logfiles for ycm, ycmd
and any completer logfiles listed by :YcmToggleLogs.

OS version, distribution, etc.

Windows 10 64bit
Python 3.5.2 32bit

Most helpful comment

You need to update the ycmd submodule. Run the command:

git submodule update --init --recursive

in YCM folder.

All 5 comments

You need to update the ycmd submodule. Run the command:

git submodule update --init --recursive

in YCM folder.

Sorry to have bothered you with something so simple. I am using vundle on all my Linux boxes which of course manages git submodules as well. For windows I am using pathogen with a simple update script and that script doesn't update the submodules as I have now realized.

Thank you!

@crapp Thanks nevertheless for reporting with all those details, because it made locating the issue so much easier (sadly still took ~30 minutes).

@micbou Is there a reason for install.py not to have this action/option? People will not realize there even are submodules, nor should they really have to. Also, git clean -dfx . before install.py doesn't DoTheRightThing(TM) in this situation.

@micbou That command is throwing an error:

error: Your local changes to the following files would be overwritten by checkout:
    build.py
    run_tests.py
Please commit your changes or stash them before you switch branches.
Aborting
Unable to checkout '13da3d47255d559308b946242e508d3531dabda5' in submodule path 'third_party/ycmd'

@revolter If you don't care about the changes made to these files, run again the command in YCM folder with the --force option:

git submodule update --init --recursive --force
Was this page helpful?
0 / 5 - 0 ratings