Vi and Vim Asked by Songcheng Li on December 22, 2021
I have been trying to compile Vim with python3 on my Mac for many hours, as a result, it looks fine now, as the following:
VIM - Vi IMproved 8.1 (2018 May 18, compiled Dec 9 2018 00:37:54) macOS version Included patches: 1-573 Huge version without GUI.
+python/dyn +python3/dyn
but when I tried to test using :echo(has('python3'))
, it gives 0.
And command like :python3 print('aha!')
gives error:
E370: Could not load library libpython3.7m.a
E263: Sorry, this command is disabled, the Python library could not be loaded.
While python2 works fine. Can anyone help me with mercy?!
Thank you so so much!
p.s. this is my .configure used:
./configure --with-features=huge
--enable-multibyte
--enable-rubyinterp=yes
--enable-python3interp=yes
--with-python3-config-dir=/Users/mac/anaconda3/lib/python3.7/config-3.7m-darwin
--enable-pythoninterp=yes --with-python-config-dir=/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
--enable-luainterp=yes
--enable-hangulinput=yes
--enable-cscope
--prefix=/usr/local/
by the way, --with-python3-config-dir=/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin
works the same.
You can use the file with extension .dylib
too, In my case, I set the path to use Xcode location.
set pythonthreedll=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/lib/libpython3.7m.dylib
Answered by Christian Daniel Avila Sanchez on December 22, 2021
Find your dynamic python lib, for example libpython3.6m.so.1.0
. Then put it in your .vimrc
like this:
set pythonthreedll=/location/of/your/python/lib/libpython3.6m.so.1.0
Of course, change the version of the library name accordingly.
Answered by peter on December 22, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP