OS: Ubuntu 18.04

First, I ran

apt-get install python3-dev ruby-dev

Then, I installed vim using the instructions in the website, using make distclean, make and make install (This was like the tenth time in one week that I was compiling from source. By the way, I know now that I should use checkinstall, but I already used make install once, so I figured I just might as well continue using it). I chose the big version of vim, and uncommented the lines as indicated in the Makefile file, located at the src folder.

On the Makefile, I also uncommented the necessary lines as indicted in that same file. I think there were 3 lines related to python3, I uncommented those but not the ones for python2. I also uncommented the lines for perl and ruby, because previous trials of installing python3 support had not worked properly.

The result

Running vim --version shows -python and +python3/dyn .

When I enter vim and run : python3 import sys or :python3 print ('Hello') I get the errors:

E370: Could not load library libpython3.7m.a
E263: Sorry, this command is disabled, the Python library could not be loaded.

Question: How do I fix this? How do I make python3 support work properly? I have heard of using apt-get for installing vim, but I would like to avoid that for learning purposes, and because I am installing Vim on my home directory. I have also read about neovim, but for learning purposes I want to work with vim now.

This answer to the post "Gvim cannot load my Python" says that one should copy the file python37.dll into Vim's directory. I do not know whether that works or not; but, if it does, is there really no other solution?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.