Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jedi latest version runtime error for Windows #1627

Closed
jdhao opened this issue Jul 2, 2020 · 11 comments
Closed

jedi latest version runtime error for Windows #1627

jdhao opened this issue Jul 2, 2020 · 11 comments

Comments

@jdhao
Copy link

jdhao commented Jul 2, 2020

I am using deoplete-jedi which in turn depends on Jedi. It seems that the latest version of Jedi or master branch of Jedi will error out for Windows.

Here is the MWE to reproduce this issue:

import jedi

source1 = '''
import os
os.
'''

script1 = jedi.Script(source1, 3, len('os.'), 'example1.py')
print(script1.completions())

Here is the test summary for different combination of platform and jedi version:

platform jedi version error out?
Windows 0.16.0 No
Windows 0.17.0 Yes
Linux 0.16.0 No
Linux 0.17.0 No

On both Linux and Windows, Python is provided by Anaconda and the version is 3.6.5.

Here is the traceback when error occurs:

Traceback (most recent call last):
  File "D:\Anaconda\lib\site-packages\jedi\inference\compiled\subprocess\__init__.py", line 261, in _send
    is_exception, traceback, result = pickle_load(self._get_process().stdout)
  File "D:\Anaconda\lib\site-packages\jedi\_compatibility.py", line 396, in pickle_load
    return pickle.load(file, encoding='bytes')
EOFError: Ran out of input

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda\lib\site-packages\jedi\api\environment.py", line 75, in _get_subprocess
    info = self._subprocess._send(None, _get_info)
  File "D:\Anaconda\lib\site-packages\jedi\inference\compiled\subprocess\__init__.py", line 273, in _send
    stderr,
jedi.api.exceptions.InternalError: The subprocess D:\Anaconda\python.exe has crashed (EOFError('Ran out of input',), stderr=).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test_jedi.py", line 8, in <module>
    script1 = jedi.Script(source1, 3, len('os.'), 'example1.py')
  File "D:\Anaconda\lib\site-packages\jedi\api\__init__.py", line 185, in __init__
    project, environment=environment, script_path=self.path
  File "D:\Anaconda\lib\site-packages\jedi\inference\__init__.py", line 90, in __init__
    self.compiled_subprocess = environment.get_inference_state_subprocess(self)
  File "D:\Anaconda\lib\site-packages\jedi\api\environment.py", line 114, in get_inference_state_subprocess
    return InferenceStateSubprocess(inference_state, self._get_subprocess())
  File "D:\Anaconda\lib\site-packages\jedi\api\environment.py", line 80, in _get_subprocess
    exc))
jedi.api.environment.InvalidPythonEnvironment: Could not get version information for 'D:\\Anaconda\\python.exe': InternalError("The subprocess D:\\Anaconda\\python.exe has crashed (EOFError('Ran out of input',), stderr=).",)
@davidhalter
Copy link
Owner

This is probably an issue with your Anaconda installation. 0.17.0 has been out for a while, so I doubt there's a fundamental issue on Windows (Also the CI passes on Windows). You can try 0.17.1 or master, but I guess that would also fail.

You can always avoid this error by using InterpreterEnvironment.

Sorry, but I won't be able to help you with this. This is not enough information. I would need at least a better traceback or access to your machine. You could try something like D:\\Anaconda\\python.exe -m jedi.inference.compiled.subprocess /path/to/parso 2, maybe that yields a better exception.

@jdhao
Copy link
Author

jdhao commented Jul 2, 2020

version 0.17.1 and master branch also crashes. I tried:

D:\\Anaconda\\python.exe -m jedi.inference.compiled.subprocess D:\\Anaconda\\Lib\\site-packages\\parso 2 test_jedi.py

or

D:\\Anaconda\\python.exe -m jedi.inference.compiled.subprocess D:\\Anaconda\\Lib\\site-packages\\parso 2

The command won't run and hangs. I am not familiar with Jedi. Can you be more specific what should I run?

@davidhalter
Copy link
Owner

The command won't run and hangs.

That's supposed to happen. I have no idea what's wrong in that case. Sorry I would need access to your machine to debug this.

@jdhao
Copy link
Author

jdhao commented Jul 2, 2020

Unfortunately, this is my work PC which can not be accessed from outside the company.

My python version is 3.6.5. Can you reproduce this issue with a conda virtual env? Meanwhile, I will try to install jedi with plain python from the python official site to see if this issue persists.

@mattlink
Copy link

mattlink commented Jul 2, 2020

This happened to me on RHEL 7.6 using python3.8 in a virtualenv coupled with Coc.nvim. Downgrading to jedi 0.17.0 fixed the issue.

@davidhalter
Copy link
Owner

davidhalter commented Jul 2, 2020

We are not passing the environment variables anymore since (v0.17.1). This is probably the problem for you @mattlink .

@davidhalter
Copy link
Owner

See also 803c3cb

@Shougo
Copy link

Shougo commented Jul 2, 2020

@jdhao Can you bisect the issue?

@davidhalter
Copy link
Owner

davidhalter commented Jul 17, 2020

Can you try master branch again? We just changed something (in #1633) about environment variables again.

0.16.0 BTW might have used a different executable (if you have multiple Python versions). I'm not sure what else could have changed between those versions.

@jdhao
Copy link
Author

jdhao commented Jul 18, 2020

@davidhalter Trying latest jedi from master:

pip install git+https://github.com/davidhalter/jedi.git@master

Now it works fine with deplete. No crash observed so far.

@davidhalter
Copy link
Owner

I guess I'm closing :) Feel free to open a new issue if it's an issue again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants