vim / vim-appimage

AppImage for gVim
115 stars 20 forks source link

how can i link to the libpython libary? #18

Closed avriltank closed 3 years ago

avriltank commented 4 years ago

This project is very nice! thanks very much! I use vim too young! I do not konw the way to link to the libpython libary!

chrisbra commented 4 years ago

I don't understand the request :/

avriltank commented 4 years ago

The document tells me "If you need a dynamic interface to Perl, Python2, Python3, Ruby or Lua make sure your system provides the needed dynamic libraries (e.g. libperlX, libpython2.7 libpython3X liblua5.1 and libruby1.9X) as those are not distributed together with the image to not make the image too large." Now my ubuntu install python3.7 and has libpython3X,but the vim can not execute the command py3

chrisbra commented 4 years ago

so please be a bit more precise. What libraries have you installed?

hupfdule commented 4 years ago

The question is more: What libraries are necessary.

In my case I have these libraries installed:

ii  libpython3-dev:amd64                          3.7.3-1                             amd64        header files and a static library for Python (default)
ii  libpython3-stdlib:amd64                       3.7.3-1                             amd64        interactive high-level object-oriented language (default python3 version)
ii  libpython3.7:amd64                            3.7.3-2+deb10u1                     amd64        Shared Python runtime library (version 3.7)
ii  libpython3.7-dev:amd64                        3.7.3-2+deb10u1                     amd64        Header files and a static library for Python (v3.7)
ii  libpython3.7-minimal:amd64                    3.7.3-2+deb10u1                     amd64        Minimal subset of the Python language (version 3.7)
ii  libpython3.7-stdlib:amd64                     3.7.3-2+deb10u1                     amd64        Interactive high-level object-oriented language (standard library, version 3.7)

Calling the following from within vim:

:py3 print("test")

prints

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

It seems that the appimage is searching for python3.4 explicitly. Having python3.7 doesn't work here.

chrisbra commented 4 years ago

try setting the pythonthreedll option setting explicitly.

nbCloud91 commented 3 years ago

I am on a linux system without root access, so I am using the latest appimage. I had a problem after setting pythonthreedll manually in my .vimrc:.

set pythonthreedll = /path/to/anaconda/base/libpython3.8.so.1.0

running :python3 print("Ok!") gives the desired output "Ok!" but also outputs a deprecation warning:

DeprecationWarning: the imp module is deprecated in favour of importlib

this is because for python versions after 3.4 imp module was deprecated, and importlib is to be used instead. But the patch 8.1.0201 of vim should have taken care of it 8.1.0201. I am not sure why I am getting this error. Any pointers to what I am doing wrong?

chrisbra commented 3 years ago

But the patch 8.1.0201 of vim should have taken care of it 8.1.0201. I am not sure why I am getting this error. Any pointers to what I am doing wrong?

Not sure, you are right, Vim 8.1.0201 should have taken care of this. Perhaps this is a difference with anaconda and default python? I suggest to try this with vim/vim repo since the latest release here is quite old (which I hope I have just fixed) and report over there if you can reproduce this still.

Thanks.

nbCloud91 commented 3 years ago

Strange, I compiled a huge version(master branch vim/vim repo) myself, it ran without a problem, no deprecation warning:

./configure                  \ 
        --with-features=huge                    \
        --enable-multibyte                      \
        --enable-pythoninterp=dynamic           \
        --enable-python3interp=dynamic          \
        --with-python-config-dir=$PY_CONFIG     \
        --with-python3-config-dir=$PY3_CONFIG   \
        --enable-cscope                         \
        --prefix=$HOME/.local

It takes a bit of time to compile and install to local/bin, that is why having an appimage is so convenient, but I guess it comes with own issues. ¯_(ツ)_/¯.

chrisbra commented 3 years ago

Yes indeed. Hopefully, we have at least updated appimages soon.