Giter Site home page Giter Site logo

Comments (8)

Yggdroot avatar Yggdroot commented on July 18, 2024

What's the output of :py3 print(sys.path) after Leaderf -h is run?

from leaderf.

arozehnal avatar arozehnal commented on July 18, 2024

:Leaderf -h
Error detected while processing function leaderf#Any#start[4]..leaderf#LfPy:
line 1:
Traceback (most recent call last):
File "", line 1, in
NameError: name 'anyHub' is not defined

:py3 print(sys.path)
['/intax/roze2/.vim/plugged/LeaderF/autoload/leaderf/python', '/opt/freeware/lib64/python37.zip', '
/opt/freeware/lib64/python3.7', '/opt/freeware/lib64/python3.7/lib-dynload', '/opt/freeware/lib64/python3.7/site-packages', '/opt/freeware/lib/python3.7/site-packages', 'vim_path']

from leaderf.

Yggdroot avatar Yggdroot commented on July 18, 2024

Duplicate of #720 .

from leaderf.

arozehnal avatar arozehnal commented on July 18, 2024

I'm new here - sorry for the stupid question...
Is my problem to be solved by reinstalling the LeaderF plugin?
I have reinstalled the plugin, including the C extension,but the result is still the same.

According to messages like
Symbol PyBool_FromLong (number 1) is not exported from dependent module vim.
I judge that the problem is in the setting/availability of some symbols in vim-leaderf-python communication.
I compiled vim to have python support bolted on statically, but the result is still the same.

vim reports that it has Python3 support, the LeaderF installation went Ok...
Question:
Is there any way to verify the functionality of LeaderF outside of Vim?

from leaderf.

Yggdroot avatar Yggdroot commented on July 18, 2024

Actually, if Leaderf -h,

if leaderf#versionCheck() == 0 " this check is necessary
finish
endif
exec g:Lf_py "from leaderf.anyExpl import *"

should have been executed.

You can run :py3 from leaderf.anyExpl import * after Leaderf -h.

To see the output of :py3 print(globals()) before and after the command above.

from leaderf.

arozehnal avatar arozehnal commented on July 18, 2024

Here is output of :py3 print(globals()) before
py3 print(globals())

{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <cl
ass '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {
}, '__builtins__': <module 'builtins' (built-in)>, 'vim': <module 'vim' (built-i
n)>, 'sys': <module 'sys' (built-in)>}

and after

{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <cl
ass '_frozen_importlib.BuiltinImporter'>, '__spec__': None, '__annotations__': {
}, '__builtins__': <module 'builtins' (built-in)>, 'vim': <module 'vim' (built-i
n)>, 'sys': <module 'sys' (built-in)>, 'os': <module 'os' from '/opt/freeware/li
b/python3.7/os.py'>, 're': <module 're' from '/opt/freeware/lib/python3.7/re.py'
>, 'cwd': '/intax/roze2/.vim/plugged/LeaderF/autoload'}

I'm not a programmer, but from the output, it seems that Vim and Python were successfully linked, but the loading of LeaderF failed, specifically the import of Python modules.

I've requested help on the AIX discussion forum as well, so we'll see.

from leaderf.

Yggdroot avatar Yggdroot commented on July 18, 2024

if leaderf#versionCheck() == 0 " this check is necessary
finish
endif
exec g:Lf_py "from leaderf.anyExpl import *"

It seems Line 14 is not executed, could you check it please?
You can add the code as below:

if leaderf#versionCheck() == 0  " this check is necessary 
     echoerr "leaderf#versionCheck() failed." 
     finish 
 endif 
  
 exec g:Lf_py "from leaderf.anyExpl import *" 

If necessary, modify the function below:

function! leaderf#versionCheck()
if g:Lf_PythonVersion == 2 && pyeval("sys.version_info < (2, 7)")
echohl Error
echo "Error: LeaderF requires python2.7+, your current version is " . pyeval("sys.version")
echohl None
return 0
elseif g:Lf_PythonVersion == 3 && py3eval("sys.version_info < (3, 1)")
echohl Error
echo "Error: LeaderF requires python3.1+, your current version is " . py3eval("sys.version")
echohl None
return 0
elseif g:Lf_PythonVersion != 2 && g:Lf_PythonVersion != 3
echohl Error
echo "Error: Invalid value of `g:Lf_PythonVersion`, value must be 2 or 3."
echohl None
return 0
endif
return 1
endfunction

as

function! leaderf#versionCheck() 
     if g:Lf_PythonVersion == 2 && pyeval("sys.version_info < (2, 7)") 
          
         echoerr "Error: LeaderF requires python2.7+, your current version is " . pyeval("sys.version") 
         
         return 0 
     elseif g:Lf_PythonVersion == 3 && py3eval("sys.version_info < (3, 1)") 
         
         echoerr "Error: LeaderF requires python3.1+, your current version is " . py3eval("sys.version") 
        
         return 0 
     elseif g:Lf_PythonVersion != 2 && g:Lf_PythonVersion != 3 
        
         echoerr "Error: Invalid value of `g:Lf_PythonVersion`, value must be 2 or 3." 
         
         return 0 
     endif 
     return 1 
 endfunction 

from leaderf.

arozehnal avatar arozehnal commented on July 18, 2024

I'd like to thank you for your willingness and helpfulness. I've come to the conclusion that the plugin is unrunnable on AIX. I tried the replacements you sent last time and didn't get much further...

`Error detected while processing /intax/roze2/.vim/plugged/LeaderF/autoload/leaderf/Any.vim:
line 16:
Traceback (most recent call last):
File "", line 1, in
File "/intax/roze2/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/anyExpl.py", line 15
, in
from .manager import *
File "/intax/roze2/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 19
, in
from .asyncExecutor import AsyncExecutor
File "/intax/roze2/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/asyncExecutor.py", l
ine 7, in
import subprocess
File "/opt/freeware/lib/python3.7/subprocess.py", line 152, in
import _posixsubprocess
ImportError: Symbol resolution failed for /opt/freeware/lib/python3.7/lib-dynload/_posixsubpro
cess.so because:
^ISymbol PyArg_ParseTuple (number 1) is not exported from dependent
^I module vim.
^ISymbol PyBytes_AsString (number 2) is not exported from dependent
^I module vim.
^ISymbol PyErr_Fetch (number 3) is not exported from dependent
^I module vim.
^ISymbol PyErr_Restore (number 4) is not exported from dependent
^I module vim.
^ISymbol PyErr_SetFromErrno (number 5) is not exported from dependent
^I module vim.
^ISymbol PyErr_SetString (number 6) is not exported from dependent
^I module vim.
Additional errors occurred but are not reported.
Examine .loader section symbols with the 'dump -Tv' command.
Error detected while processing function leaderf#Any#start[4]..leaderf#LfPy:
line 1:
Traceback (most recent call last):

I tried a little search for Symbol PyArg_ParseTuple (number 1)
and found ... https://bugs.python.org/issue13493
I've long ago accepted that rows of things are common on Linux, but on AIX there is a problem.
Thanks again for the help, I'm going to run LeaderF on windows :-)

from leaderf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.