vim-config icon indicating copy to clipboard operation
vim-config copied to clipboard

make requires PyYAML

Open weiss-d opened this issue 5 years ago • 3 comments

On Pop!_OS 20.04 make bursts with errors asking to install PyYAML. After pip3 install --user PyYAML it works fine.

Full error output:

weissd@weissmachine:~/.config/nvim$ make test
Testing NVIM 0.4+...
OK
All tests passed, hooray!
weissd@weissmachine:~/.config/nvim$ make
mkdir: created directory '/home/weissd/.cache/vim'
mkdir: created directory '/home/weissd/.cache/vim/backup'
mkdir: created directory '/home/weissd/.cache/vim/session'
mkdir: created directory '/home/weissd/.cache/vim/swap'
mkdir: created directory '/home/weissd/.cache/vim/tags'
mkdir: created directory '/home/weissd/.cache/vim/undo'
nvim -V1 -es -i NONE -N --noplugin -u config/init.vim \
	-c "try | call dein#clear_state() | call dein#update() | finally | messages | qall! | endtry"
:!git clone https://github.com/Shougo/dein.vim /home/weissd/.cache/vim/dein/repos/github.com/Shougo/dein.vim

Cloning into '/home/weissd/.cache/vim/dein/repos/github.com/Shougo/dein.vim'...

[config/init] Unable to find a proper YAML parsing utility.
[config/init] Please run: pip3 install --user PyYAML
[config/init] 'Vim(return):E474: Unidentified byte: /bin/bash: ruby: command not found^@'
[config/init] Error loading /home/weissd/.config/nvim/config/plugins.yaml
[config/init] Caught: 'Vim(return):E474: Unidentified byte: /bin/bash: ruby: command not found^@'
[config/init] Unable to read configuration files at ['/home/weissd/.config/nvim/config/plugins.yaml']
Error detected while processing function <SNR>1_main[46]..<SNR>1_use_dein[27]..<SNR>1_parse_config_files:
line   10:
Vim(let):E712: Argument of extend() must be a List or Dictionary
Error detected while processing function <SNR>1_main[46]..<SNR>1_use_dein:
line   27:
E171: Missing :endif
not found in 'runtimepath': "ftdetect/*.vim"
[dein] Target plugins are not found.
[dein] You may have used the wrong plugin name, or all of the plugins are already installed.
[config/init] Unable to find a proper YAML parsing utility.
[config/init] Please run: pip3 install --user PyYAML
[config/init] 'Vim(return):E474: Unidentified byte: /bin/bash: ruby: command not found^@'
[config/init] Error loading /home/weissd/.config/nvim/config/plugins.yaml
[config/init] Caught: 'Vim(return):E474: Unidentified byte: /bin/bash: ruby: command not found^@'
[config/init] Unable to read configuration files at ['/home/weissd/.config/nvim/config/plugins.yaml']
Error detected while processing function <SNR>1_main[46]..<SNR>1_use_dein[27]..<SNR>1_parse_config_files:
line   10:
Vim(let):E712: Argument of extend() must be a List or Dictionary
Error detected while processing function <SNR>1_main[46]..<SNR>1_use_dein:
line   27:
E171: Missing :endif
not found in 'runtimepath': "ftdetect/*.vim"
[dein] Target plugins are not found.
[dein] You may have used the wrong plugin name, or all of the plugins are already installed.make: *** [Makefile:21: update-plugins] Error 1

weiss-d avatar Sep 07 '20 13:09 weiss-d

Thanks for posting this. Because the way I define plugins inside a YAML file, and vim only knows to parse JSON, it looks for these tools (in this order) in-order to convert YAML to JSON:

  • yj
  • yq
  • yaml2json
  • ruby
  • python + PyYAML installed

If none of these tools are present, it fails because it can't parse the YAML. I'm not familiar with Pop!_OS, can you think of a way to convert YAML to JSON with the tools installed on Pop!_OS?

rafi avatar Sep 10 '20 17:09 rafi

Hi, @rafi! Pop!_OS is based on Ubuntu and none of these options are installed by default in Ubuntu 20.04 either.

weiss-d avatar Sep 11 '20 07:09 weiss-d

Unfortunately this is the compromise I must take in-order to configure my plugins in YAML format. This is where the tools are being detected: https://github.com/rafi/vim-config/blob/master/config/init.vim#L348-L375

You'll have to pip3 install --user PyYaml or install yj/yq unfortunately.

rafi avatar Sep 01 '21 16:09 rafi

Hi there,

Having a bit of difficulty getting yj or yq detected on install even though the binaries are present in $PATH. I've downloaded the binaries and confirmed that they are executable and present as the exact names of yj or yq in $PATH - but still I receive the error recommending install of PyYAML. I can only get make to install all of the plugins by only having PyYAML in my environment.

This problem occurs on Ubuntu 20.04 and a docker image based on Ubuntu 22.04 through my testing.

chang-alan-l avatar Dec 30 '22 10:12 chang-alan-l

PyYAML/yj/yq/etc. is no longer needed. Pushed a whole new rewrite of vim-config, 100% lua and lazy.nvim as package-manager, check it out...

rafi avatar Apr 07 '23 16:04 rafi