Closed CharlesARoy closed 3 years ago
So, first, thanks for the detailed report! I and fairly sure neither of these are Vimspector bugs, based on the errors above, but as you've gone to the trouble of providing so much useful detail, I'm happy to provide support :)
Taking them in turn.
Plugin
(presumably vundle) to install the plugin, then used packadd! vimspector
. This is wrong. packadd
is only for using vim packages (read :halp packages). It's pretty clear in the docs that there are 2 different methods, and you should only use one: https://github.com/puremourning/vimspector#quick-start.Solution: remove packadd! vimspector
from your vimrc.
Could you please run these commands from inside Vim?
:py3 print( __import__( 'sys' ).version )
:py3 import vim
:py3 import vimspector
That should either highlight or disprove my theory about python installation problems.
BUT: Spoiler alert, I'm willing to bet €1 that the problem is anaconda. I see that your vim seems to link against anaconda python (-L/Users/charles/anaconda3/lib/python3.8/config-3.8-darwin
) which in my experience is a total nightmare of pain and suffering. Try rebuilding your vim against homebrew python, or install macvim from homebrew instead of vim.
Also your sys paths seems very wonky. What's concourse
?
sys.base_prefix = '/opt/concourse/worker/...
So I saw your post on vim_dev. Looks like you were having some problems building vim from source that ultimately may have related to anaconda...
I'd suggest just using hombrew vim (that's what I use!), as in brew install vim
(or brew upgrade vim
). You may need something like brew link --overwrite vim
as it looks like your manually installed files are likely to conflict with where homebrew will want to put its symlinks. Alternatively MacVim should work just fine too (either brew install --cask macvim
or install from Mac vim app bundle).
Give me a shout on Gitter if you have any further problems.
Thank you SO much for the help! This has definitely been a total nightmare of pain and suffering haha.
Ok, so when I run any of those :py3...
commands in VIM, I get the same error as when I was trying to launch the debugger:
Could not find platform independent libraries prefix
Could not find platform dependent libraries
I'm not sure what's up with concourse, it's not something I installed intentionally. I can't find much on it but came across this post which is listed under "ContinuumIO/anaconda-issues", so it may be something anaconda uses.
I would probably prefer using the macvim that's already available in macOS so that I don't have to have any extra copies of vim hanging around. However, as I mentioned in that vim_dev issue the documentation for Vimspector says that you need "Vim 8.2 Huge build compiled with Python 3.6 or later" and the version of Vim that comes with mac (macvim) is 8.1 and isn't compiled with python3 seemingly.
When I tried launching vimspector in macvim, I'd get the following error: Vimspector unavailable: Requires Vim compiled with Python 3.6
Running vim --version
for macvim returns:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 5 2020 21:30:37)
macOS version
Included patches: 1-503, 505-680, 682-2292
Compiled by root@apple.com
Normal version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
-arabic +file_in_path -mouse_urxvt -tcl
+autocmd +find_in_path +mouse_xterm -termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
-balloon_eval -footer -mzscheme +termresponse
-balloon_eval_term +fork() +netbeans_intg +textobjects
-browse -gettext +num64 +textprop
+builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand -perl -toolbar
+cindent +job +persistent_undo +user_commands
-clientserver +jumplist +postscript -vartabs
+clipboard -keymap +printer +vertsplit
+cmdline_compl +lambda -profile +virtualedit
+cmdline_hist -langmap +python/dyn +visual
+cmdline_info +libcall -python3 +visualextra
+comments +linebreak +quickfix +viminfo
-conceal +lispindent +reltime +vreplace
+cryptv +listcmds -rightleft +wildignore
+cscope +localmap +ruby/dyn +wildmenu
+cursorbind -lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con +mksession +smartindent -X11
+diff +modify_fname -sound -xfontset
+digraphs +mouse +spell -xim
-dnd -mouseshape +startuptime -xpm
-ebcdic -mouse_dec +statusline -xsmp
-emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra -mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa
For some reason when I last installed VIM with homebrew, I thought that it was also not compiled with python3, which is why I went through the whole process of compiling vim from the source with the settings you mention here.
However, I must have made a mistake somewhere because after removing the manually compiled copy of vim and installing it with brew, I was finally able to launch the debugger without getting the python error message.
TLDR For anyone reading this, these are the exact steps I took to get everything working for debugging python:
brew install vim
brew link --overwrite vim
Plugin 'puremourning/vimspector'
to the Plugins section of my .vimrc filelet g:vimspector_enable_mappings = 'HUMAN'
to the bottom of my .vimrc file:PluginInstall
in VIM to install vimspector~/.vim/bundle/vimspector
and ran python3 install_gadget.py --all
:call vimspector#Launch()
to start the debuggerVIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 5 2020 21:30:37) macOS version Included patches: 1-503, 505-680, 682-2292 Compiled by root@apple.com
that's not MacVim, this is MacVIm: https://macvim-dev.github.io/macvim/
Describe the bug
I've been trying to get vimspector working for days now and would really appreciate some help. It looks amazing and I can't wait to use it! Basically, when I launch vim, I get the following error/warnings regarding vimspector:
Error detected while processing /Users/charles/.vimrc: line 100: E919: Directory not found in 'packpath': "pack/*/opt/vimspector"
Then when I run
:call vimspector#Launch()
inside VIM I get the following error:Could not find platform independent libraries prefix Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/usr/local/bin/vim'
sys.base_prefix = '/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol'
sys.base_exec_prefix = '/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol'
sys.executable = '/usr/local/bin/vim'
sys.prefix = '/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol'
sys.exec_prefix = '/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol'
sys.path = [
'/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python38.zip',
'/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.8',
'/opt/concourse/worker/volumes/live/71f8613d-c53a-40aa-4c7b-351131b1952c/volume/python_1599203882312/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000000101c2fdc0 (most recent call first):
no Python frame
Minimal reproduciton
vim -Nu /path/to/vimspector/support/minimal_vimrc
? No for the first issue: E919: Directory not found in 'packpath': "pack/*/opt/vimspector" Yes for the second issue::call vimspector#Launch()
Expected behaviour
I expect vimspector to launch in debugging mode and look like the debugging setup in this video.
Actual behaviour
Note that this is what's in the log file but this isn't from the most recent runs with the current bugs which were run today (2021-01-08).
2021-01-07 16:37:53,650 - INFO - INITIALISING NEW VIMSPECTOR SESSION 2021-01-07 16:37:53,650 - INFO - API is: 2021-01-07 16:37:53,650 - INFO - VIMSPECTOR_HOME = /Users/charles/.vim/bundle/vimspector 2021-01-07 16:37:53,650 - INFO - gadgetDir = /Users/charles/.vim/bundle/vimspector/gadgets/macos 2021-01-07 16:37:53,650 - INFO - User requested start debug session with {} 2021-01-07 16:37:53,651 - DEBUG - Reading configurations from: None 2021-01-07 16:37:53,651 - DEBUG - Reading configurations from: None 2021-01-07 16:37:53,651 - INFO - User Msg: Unable to find any debug configurations. You need to tell vimspector how to launch your application.
Environemnt
Version of Vimspector: 07ea3880acf5977075831c64536e683ddb2fed89
Output of
vim --version
ornvim --version
Output of
which vim
orwhich nvim
::py3 print( __import__( 'sys' ).version )
::py3 import vim
::py3 import vimspector
:Declaration
Additional information
From filling in this ticket it would seem that part of my issue might have to do with not having py3; however, py3 occurs zero times in the documentation. Is python3 not sufficient? This is my output when I run
which -a python3
As I was trying to fix this I came across this page that has some information regarding the python error I'm getting. However, I've tried all kinds of combination of setting and unsettling PYTHONPATH and PYTHONHOME to each of the above python installations on my computer and none of that worked. As far as I know, I'm not using any kind of virtual environments.
I have the following vimspector-related commands in my .vimrc file: