Giter Site home page Giter Site logo

Comments (9)

krya avatar krya commented on May 27, 2024

my guess is that numpy is compiled against different python version
thus jedi cant import it.
could you try #40 ?

from sublimejedi.

chinux23 avatar chinux23 commented on May 27, 2024

I got these import error from sublime console without pull#40 linked above. (I will try the pull/40).

I am using python3, but sublimeJedi seems to import with a python2.7 numpy. not sure if related.

Traceback (most recent call last):
File "./sublime_plugin.py", line 237, in on_query_completions
File "./sublime_jedi.py", line 302, in on_query_completions
completions = self.get_completions(view, locations)
File "./sublime_jedi.py", line 319, in get_completions
completions = self.completions_from_script(script, view) +
File "./sublime_jedi.py", line 214, in completions_from_script
completions = script.completions()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/api_classes.py", line 44, in wrapper
result = func(_args, *_kwds)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/api.py", line 94, in completions
scopes = list(self._prepare_goto(path, True))
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/api.py", line 190, in _prepare_goto
scopes = evaluate.follow_statement(stmt)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/recursion.py", line 31, in call
result = self.func(stmt, _args, *_kwargs)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/cache.py", line 101, in wrapper
rv = function(_args, *_kwargs)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/evaluate.py", line 583, in follow_statement
result = follow_call_list(commands)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/common.py", line 56, in wrapper
return func(_args, *_kwds)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/evaluate.py", line 654, in follow_call_list
result += follow_call(call)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/evaluate.py", line 672, in follow_call
return follow_call_path(path, s.parent, s.start_pos)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/evaluate.py", line 695, in follow_call_path
result = imports.strip_imports(scopes)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 317, in strip_imports
result += ImportPath(s).follow()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 193, in follow
scopes += remove_star_imports(scope)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/cache.py", line 158, in wrapper
mods = func(scope, _args, *_kwargs)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 331, in remove_star_imports
modules = strip_imports(i for i in scope.get_imports() if i.star)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 317, in strip_imports
result += ImportPath(s).follow()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 193, in follow
scopes += remove_star_imports(scope)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/cache.py", line 158, in wrapper
mods = func(scope, _args, *_kwargs)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 331, in remove_star_imports
modules = strip_imports(i for i in scope.get_imports() if i.star)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 317, in strip_imports
result += ImportPath(s).follow()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 193, in follow
scopes += remove_star_imports(scope)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/cache.py", line 158, in wrapper
mods = func(scope, _args, *_kwargs)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 331, in remove_star_imports
modules = strip_imports(i for i in scope.get_imports() if i.star)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 317, in strip_imports
result += ImportPath(s).follow()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 186, in follow
scope, rest = self._follow_file_system()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/imports.py", line 306, in _follow_file_system
return f.parser.module, rest
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/modules.py", line 48, in parser
or self._load_module()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/modules.py", line 55, in _load_module
source = self._get_source()
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/builtin.py", line 124, in _get_source
return _generate_code(self.module, self._load_mixins())
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/builtin.py", line 119, in module
load_module(name, path)
File "/Users/chen/Library/Application Support/Sublime Text 2/Packages/SublimeJEDI-0.6.1/jedi/builtin.py", line 90, in load_module
exec_function('import %s as module' % name, content)
File "blub", line 2, in exec_function
File "", line 1, in
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/init.py", line 137, in
import add_newdocs
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/add_newdocs.py", line 9, in
from numpy.lib import add_newdoc
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/lib/init.py", line 4, in
from type_check import *
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/lib/type_check.py", line 8, in
import numpy.core.numeric as _nx
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/init.py", line 5, in
import multiarray
ImportError: dlopen(/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/multiarray.so, 2): Symbol not found: _PyCapsule_Import
Referenced from: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/multiarray.so
Expected in: flat namespace
in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/multiarray.so

from sublimejedi.

chinux23 avatar chinux23 commented on May 27, 2024

It seems Sublimetext has its own version of python interpreter. that might creates all sorts of issues for numpy. I'll test the new hope :)

from sublimejedi.

srusskih avatar srusskih commented on May 27, 2024

Hi.

You guys right. Jedi use Sublime python interpreter but sys path from "custom" environment. Thats my we have this troubles with numpy now and in future.

#40 looks promising. But PR still contains lots of changes for plugin code, and i don't like it. I'll write my thoughts in PR soon.

from sublimejedi.

chinux23 avatar chinux23 commented on May 27, 2024

#40 is working for me, just a little slow for the completion to show up. But otherwise seems fine.

from sublimejedi.

srusskih avatar srusskih commented on May 27, 2024

For all packages completion is slow or only for numpy ?

from sublimejedi.

chinux23 avatar chinux23 commented on May 27, 2024

For all packages.

from sublimejedi.

srusskih avatar srusskih commented on May 27, 2024

Sounds like a trouble...

from sublimejedi.

srusskih avatar srusskih commented on May 27, 2024

Strange, but I can not see a slow access, when I working out with python projects

from sublimejedi.

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.