-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
sys.executable might be Vim itself with embedded Python (UnpicklingError) #870
Comments
I have no idea what this could be. lol. This sounds like such a weird issue. Anyone else? |
+1 Reverting to 0.9.0 from master fixed the issue while editing Python 3 code. This is GVim on Windows (all 64bit, GVim and Python) and a new Gvim instance opens on |
@micbou Do you have any idea what this could be? I think this might be related to how Jedi starts subprocesses, but I have no idea about these Windows issues. Contrary to YCM Jedi is run directly in VIM's embedded Python. |
I can no longer reproduce issue editing same python source file after a JediClearCache and a fresh new GVim instance. |
I can reproduce the issue by running the sys.executable = os.path.join(sys.prefix, 'python.exe') |
We already do this for prefix anyway, because it gets messed up by virtualenvs, so this would be a good solution I think. |
hello .how did you solve it ? I had the same problem. |
put into .vimrc or _vimrc file |
@AndreyZhdanov Could you try to put that to the beginning of |
@davidhalter Yes. I put after But I still prefer to have this piece in _vimrc beer in mind update of the script. And it looks like vim bug not issue with jedi-vim. What is your opinion ? |
It would be useful to have this git-bisected to the commi where it started to happen. |
|
@AndreyZhdanov |
Can confirm: Reverting to |
@tngreene |
Fortunately, this does not scream implausible to me. |
@tngreene Can you post the output from running the Vim commands from the first point in #870 (comment), please? |
@blueyed Did you miss #870 (comment)? This comment explains the issue and gives a solution so it should only be a matter of implementing it. |
Running with :py breaks, because I don't have Python 2 installed. with :py3 it prints |
@micbou It is clear now: since Python is linked into GVim As for fixing this in jedi/jedi-vim: please submit a PR. |
This has already been discussed on the Vim mailing list and it's not an issue with Vim but a peculiarity of Python on Windows: when a program is embedding Python,
I would if I were a user of jedi-vim but I am not. |
You missed importing
This made it work for me. Thank you! Looking forward to an official fix, however! That way no one else gets confused. |
Hi, Finally, I have again issue of launching gvim.exe instead of python.exe. Reverting this commit from version v0.13.1 of jedi allow JediDebugInfo to work correctly. Hope this help. |
@lboulard @davidhalter
Where is that? I think a fix needs to be applied to https://github.com/davidhalter/jedi/blob/3bdb941daa2d87947fa265ebcf7d94f68efbc42d/jedi/api/environment.py#L133 (if it should be done for Jedi, which makes sense, since Python might be embedded also in non-Vim apps). |
Any update about the fix? |
I have the same issue. |
@blueyed https://github.com/davidhalter/jedi-vim/blob/master/pythonx/jedi_vim.py#L31
I tend to agree. But what would be a good fix? I'm not really sure how to do get the executable path of Python if |
…8a69 * rplugin/python3/deoplete/vendored/jedi 2f86f54...0bf8a69 (7): > v13.3 release notes > A small improvement for environments > Check for specific Python versions first on unix, see davidhalter/jedi-vim#870 > Cleanup SameEnvironment and use the same logic for creation in virtualenvs > Revert "Remove an used function" > Fix embedded Python with Jedi (see comments in source code), fixes davidhalter/jedi-vim#870 > Remove an used function
@davidhalter |
I updated vim-jedi (and jedi) and it works correctly now without my previous vimrc workaround. Thanks! |
…rce code), fixes davidhalter/jedi-vim#870 Dave Halter (9): setup.py was not executable in Python3.7 Improve an error message, see #1279 Remove an used function Fix embedded Python with Jedi (see comments in source code), fixes davidhalter/jedi-vim#870 Revert "Remove an used function" Cleanup SameEnvironment and use the same logic for creation in virtualenvs Check for specific Python versions first on unix, see davidhalter/jedi-vim#870 A small improvement for environments v13.3 release notes Marc Zimmermann (1): fixing permission denied errors with project.json
vim/vimrc: Disable but do not remove the workaround for davidhalter/jedi-vim#870 now that it is closed.
+++++++++++++++++++ - Added ``Project`` support. This allows a user to specify which folders Jedi should work with. - Added support for Refactoring. The following refactorings have been implemented: ``Script.rename``, ``Script.inline``, ``Script.extract_variable`` and ``Script.extract_function``. - Added ``Script.get_syntax_errors`` to display syntax errors in the current script. - Added code search capabilities both for individual files and projects. The new functions are ``Project.search``, ``Project.complete_search``, ``Script.search`` and ``Script.complete_search``. - Added ``Script.help`` to make it easier to display a help window to people. Now returns pydoc information as well for Python keywords/operators. This means that on the class keyword it will now return the docstring of Python's builtin function ``help('class')``. - The API documentation is now way more readable and complete. Check it out under https://jedi.readthedocs.io. A lot of it has been rewritten. - Removed Python 3.4 support - Many bugfixes This is likely going to be the last minor version that supports Python 2 and Python3.5. Bugfixes will be provided in 0.17.1+. The next minor/major version will probably be Jedi 1.0.0. 0.16.0 (2020-01-26) +++++++++++++++++++ - **Added** ``Script.get_context`` to get information where you currently are. - Completions/type inference of **Pytest fixtures**. - Tensorflow, Numpy and Pandas completions should now be about **4-10x faster** after the first time they are used. - Dict key completions are working now. e.g. ``d = {1000: 3}; d[10`` will expand to ``1000``. - Completion for "proxies" works now. These are classes that have a ``__getattr__(self, name)`` method that does a ``return getattr(x, name)``. after loading them initially. - Goto on a function/attribute in a class now goes to the definition in its super class. - Big **Script API Changes**: - The line and column parameters of ``jedi.Script`` are now deprecated - ``completions`` deprecated, use ``complete`` instead - ``goto_assignments`` deprecated, use ``goto`` instead - ``goto_definitions`` deprecated, use ``infer`` instead - ``call_signatures`` deprecated, use ``get_signatures`` instead - ``usages`` deprecated, use ``get_references`` instead - ``jedi.names`` deprecated, use ``jedi.Script(...).get_names()`` - ``BaseName.goto_assignments`` renamed to ``BaseName.goto`` - Add follow_imports to ``Name.goto``. Now its signature matches ``Script.goto``. - **Python 2 support deprecated**. For this release it is best effort. Python 2 has reached the end of its life and now it's just about a smooth transition. Bugs for Python 2 will not be fixed anymore and a third of the tests are already skipped. - Removed ``settings.no_completion_duplicates``. It wasn't tested and nobody was probably using it anyway. - Removed ``settings.use_filesystem_cache`` and ``settings.additional_dynamic_modules``, they have no usage anymore. Pretty much nobody was probably using them. 0.15.2 (2019-12-20) +++++++++++++++++++ - Signatures are now detected a lot better - Add fuzzy completions with ``Script(...).completions(fuzzy=True)`` - Files bigger than one MB (about 20kLOC) get cropped to avoid getting stuck completely. - Many small Bugfixes - A big refactoring around contexts/values 0.15.1 (2019-08-13) +++++++++++++++++++ - Small bugfix and removal of a print statement 0.15.0 (2019-08-11) +++++++++++++++++++ - Added file path completions, there's a **new** ``Completion.type`` now: ``path``. Example: ``'/ho`` -> ``'/home/`` - ``*args``/``**kwargs`` resolving. If possible Jedi replaces the parameters with the actual alternatives. - Better support for enums/dataclasses - When using Interpreter, properties are now executed, since a lot of people have complained about this. Discussion in #1299, #1347. New APIs: - ``Name.get_signatures() -> List[Signature]``. Signatures are similar to ``CallSignature``. ``Name.params`` is therefore deprecated. - ``Signature.to_string()`` to format signatures. - ``Signature.params -> List[ParamName]``, ParamName has the following additional attributes ``infer_default()``, ``infer_annotation()``, ``to_string()``, and ``kind``. - ``Name.execute() -> List[Name]``, makes it possible to infer return values of functions. 0.14.1 (2019-07-13) +++++++++++++++++++ - CallSignature.index should now be working a lot better - A couple of smaller bugfixes 0.14.0 (2019-06-20) +++++++++++++++++++ - Added ``goto_*(prefer_stubs=True)`` as well as ``goto_*(prefer_stubs=True)`` - Stubs are used now for type inference - Typeshed is used for better type inference - Reworked Name.full_name, should have more correct return values 0.13.3 (2019-02-24) +++++++++++++++++++ - Fixed an issue with embedded Python, see davidhalter/jedi-vim#870 0.13.2 (2018-12-15) +++++++++++++++++++ - Fixed a bug that led to Jedi spawning a lot of subprocesses. 0.13.1 (2018-10-02) +++++++++++++++++++ - Bugfixes, because tensorflow completions were still slow. 0.13.0 (2018-10-02) +++++++++++++++++++ - A small release. Some bug fixes. - Remove Python 3.3 support. Python 3.3 support has been dropped by the Python foundation. - Default environments are now using the same Python version as the Python process. In 0.12.x, we used to load the latest Python version on the system. - Added ``include_builtins`` as a parameter to usages. - ``goto_assignments`` has a new ``follow_builtin_imports`` parameter that changes the previous behavior slightly. 0.12.1 (2018-06-30) +++++++++++++++++++ - This release forces you to upgrade parso. If you don't, nothing will work anymore. Otherwise changes should be limited to bug fixes. Unfortunately Jedi still uses a few internals of parso that make it hard to keep compatibility over multiple releases. Parso >=0.3.0 is going to be needed. 0.12.0 (2018-04-15) +++++++++++++++++++ - Virtualenv/Environment support - F-String Completion/Goto Support - Cannot crash with segfaults anymore - Cleaned up import logic - Understand async/await and autocomplete it (including async generators) - Better namespace completions - Passing tests for Windows (including CI for Windows) - Remove Python 2.6 support
(sorry for miss spellings, I'm french and I'll try my best to explain my issue)
Issue
When I try to or when jedi-vim want to help me, a new window of gvim pop-up with main.py oppened from jedi's file instead of the list of propositions and sometimes, when I go back to the previews window, gvim stop working...
Steps to reproduce
here is my _vimrc ::
Output of “:verbose JediDebugInfo”
when I do this command, the same windows apear with
The text was updated successfully, but these errors were encountered: