srusskih / SublimeJEDI

awesome Python autocompletion with SublimeText
MIT License
938 stars 109 forks source link

SublimeJEDI not working on Windows10 #272

Closed moenn closed 6 years ago

moenn commented 6 years ago

I just freshly installed Sublime Text 3 , and clone SublimeJEDI to C:\Users\xxxx\AppData\Roaming\Sublime Text 3\Packages . But it didn't work when I write python code to test , no completion , and shortcut keys like ["alt+ctrl+d"] didn't do anything.

Here's log from sublime text console:

Traceback (most recent call last):
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 140, in wrapper
    return dct[key]
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 140, in wrapper
    return dct[key]
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./python3.3/subprocess.py", line 1104, in _execute_child
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 685, in on_query_completions
    res = vel.on_query_completions(prefix, locations)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\completion.py", line 154, in on_query_completions
    location=locations[0]
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\daemon.py", line 75, in ask_daemon_with_timeout
    daemon = _get_daemon(view)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\daemon.py", line 35, in _get_daemon
    DAEMONS[window_id] = Daemon(settings=get_settings(view))
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\daemon.py", line 150, in __init__
    self.sys_path = self.env.get_sys_path()
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 142, in wrapper
    result = method(self, *args, **kwargs)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\api\environment.py", line 116, in get_sys_path
    return self._get_subprocess().get_sys_path()
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\evaluate\compiled\subprocess\__init__.py", line 169, in get_sys_path
    return self._send(None, functions.get_sys_path, (), {})
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\evaluate\compiled\subprocess\__init__.py", line 197, in _send
    pickle_dump(data, self._process.stdin, self._pickle_protocol)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 142, in wrapper
    result = method(self, *args, **kwargs)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\evaluate\compiled\subprocess\__init__.py", line 152, in _process
    bufsize=-1
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\_compatibility.py", line 510, in __init__
    super(GeneralizedPopen, self).__init__(*args, **kwargs)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1110, in _execute_child
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
Traceback (most recent call last):
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 140, in wrapper
    return dct[key]
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 140, in wrapper
    return dct[key]
KeyError: ((), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./python3.3/subprocess.py", line 1104, in _execute_child
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 685, in on_query_completions
    res = vel.on_query_completions(prefix, locations)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\completion.py", line 154, in on_query_completions
    location=locations[0]
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\daemon.py", line 75, in ask_daemon_with_timeout
    daemon = _get_daemon(view)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\daemon.py", line 35, in _get_daemon
    DAEMONS[window_id] = Daemon(settings=get_settings(view))
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\sublime_jedi\daemon.py", line 150, in __init__
    self.sys_path = self.env.get_sys_path()
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 142, in wrapper
    result = method(self, *args, **kwargs)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\api\environment.py", line 116, in get_sys_path
    return self._get_subprocess().get_sys_path()
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\evaluate\compiled\subprocess\__init__.py", line 169, in get_sys_path
    return self._send(None, functions.get_sys_path, (), {})
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\evaluate\compiled\subprocess\__init__.py", line 197, in _send
    pickle_dump(data, self._process.stdin, self._pickle_protocol)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\cache.py", line 142, in wrapper
    result = method(self, *args, **kwargs)
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\evaluate\compiled\subprocess\__init__.py", line 152, in _process
    bufsize=-1
  File "C:\Users\jms29\AppData\Roaming\Sublime Text 3\Packages\Jedi - Python autocompletion\dependencies\jedi\_compatibility.py", line 510, in __init__
    super(GeneralizedPopen, self).__init__(*args, **kwargs)
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1110, in _execute_child
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

Is there anything i can do to fix it ? I reinstalled it several times but didn't work. Sublime Text version : 3.1.1, Build 3176 Python version : 3.7.0

srusskih commented 6 years ago

@mozjiang hi! Could you please share your jedi settings?

moenn commented 6 years ago

@srusskih hi , here's jedi's default setting. I dont have user setting.

{
    // You can set a path to your python virtualenv,
    // for example `/home/user/.virtualenvs/myenv)`.
    // Note: Interpreter path would be found automaticaly
    "python_virtualenv": "",

    // You can set a path to your python interpreter,
    // for example `/home/user/.virtualenvs/myenv/bin/python)`.
    "python_interpreter": "",

    // Additional python package paths.
    "python_package_paths": [],

    // When executing "Go to definition"
    // true: Will go to directly to the term definition or declaration
    // false: Will follow the import path back to where it is is originally
    //        defined
    "follow_imports": true,

    // Which function arguments to insert in autocompletion:
    // "all" - all
    // "required" - those with no default value (that are required)
    // "" - none
    "auto_complete_function_params": "required",

    // "debug", "error", "info", "warn"
    "logging_level": "warn",

    // Which completions to show:
    // "all" - both jedi's and sublime's
    // "jedi" - only jedi's
    // "default" - only jedi's if it has something to show, otherwise sublime's
    "sublime_completions_visibility": "default",

    // how to open goto definition result with ability to show it transient
    // variation (preview only. it won't have a tab assigned it until modified):
    // "single-panel" - opens a file in same layout (default)
    // "single-panel-transient" - same as above but in transient mode
    // "two-panel" - opens a file in a split to two columns layout
    // "two-panel-transient" - same as above but in transient mode
    "sublime_goto_layout": "single-panel",

    // Use hover popup to display the docstring of a function.
    // "true" - replace ST's goto defintion popup by jedi's docstring popup
    // "false" - use ST's default goto definition popup
    "enable_tooltip": true,

    // SublimeREPL integration
    "enable_in_sublime_repl": false
}
moenn commented 6 years ago

At the beginning of install jedi , I cloned SublimeJEDI to C:\Program Files\Sublime Text 3\Packages , it's a mistake 😄 . Does it have any effect to this problem ? already deleted it.

srusskih commented 6 years ago

cloning is not a problem at all, I use the plugin in same way due to I do some development :)

sr@mb-sruskykh ~ $ cd Library/Application\ Support/Sublime\ Text\ 3/Packages/
sr@mb-sruskykh ~/L/A/S/Packages $ ls -la
total 16
drwx------  18 sr  staff   576 May 22 14:32 .
drwx------  10 sr  staff   320 May 15 12:04 ..
-rw-r--r--@  1 sr  staff  6148 Nov 28  2016 .DS_Store
lrwxr-xr-x   1 sr  staff    47 May 22 14:32 Jedi - Python autocompletion -> /Users/sr/projects/Jedi - Python autocompletion
srusskih commented 6 years ago

I think jedi unable to find python. Have you tried to set up a python_interpreter? If not please try, maybe that will solve the issue.

moenn commented 6 years ago

@srusskih Yeah, adding python_interpreter path solved this problem , now jedi runs perfectly 😄 . Thank you for your time .

"python_interpreter": "C:\\Users\\jms29\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe",
srusskih commented 6 years ago

@mozjiang you are welcome. happy hacking :)