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

Command 'UltiSnipsEdit' raises an error. #1561

Closed
azubirif opened this issue Dec 25, 2024 · 8 comments
Closed

Command 'UltiSnipsEdit' raises an error. #1561

azubirif opened this issue Dec 25, 2024 · 8 comments

Comments

@azubirif
Copy link

Expected behavior:
Be able to edit my snippets.

Actual behavior:
The following error is being raised:

AttributeError: type object 'PathFinder' has no attribute 'find_module'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "", line 1, in <module>
SystemError: initialization of vim raised unreported exception
línea   11:
AttributeError: type object 'PathFinder' has no attribute 'find_module'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "", line 1, in <module>
  File "C:\Users\aleja\vimfiles\plugged\ultisnips\pythonx\UltiSnips\__init__.py", line 6, in <module>
    from UltiSnips.snippet_manager import UltiSnips_Manager
  File "C:\Users\aleja\vimfiles\plugged\ultisnips\pythonx\UltiSnips\snippet_manager.py", line 11, in <mod
ule>
    import vim
SystemError: initialization of vim raised unreported exception
Se ha detectado un error al procesar function UltiSnips#Edit:
línea    6:
Traceback (most recent call last):
  File "", line 1, in <module>
NameError: name 'vim' is not defined

Steps to reproduce

  1. Install UltiSnips through vim-plug.
  2. Open Vim and run :UltiSnipsEdit
    Here is the only thing related to UltiSnips in my .vimrc:
call plug#begin()
Plug 'sirver/ultisnips'
...
call plug#end()

@SirVer
Copy link
Owner

SirVer commented Dec 26, 2024 via email

@Konfekt
Copy link
Contributor

Konfekt commented Jan 13, 2025

I am also getting this on Windows now since a recent update; usually this was due to Vim's :python3 import sys; print(sys.version) and the OS's python3 --version differing; does not seem to be the case this time.

@Konfekt
Copy link
Contributor

Konfekt commented Jan 13, 2025

This is using a Scoop install of Vim and Python3; a workaround could be installing vim-tux/nightly from the versions bucket; for example vim-tux fixes the error here.

@zackb2020
Copy link

zackb2020 commented Feb 14, 2025

This looks like due to find_module being removed from Python 3.13.
https://docs.python.org/release/3.13.0/whatsnew/changelog.html
gh-98040: Remove more deprecated importlib APIs: find_loader(), find_module(), importlib.abc.Finder, pkgutil.ImpImporter, pkgutil.ImpLoader.
Looks like solved here:
vim/vim#14776

@bothyhead
Copy link

I got the same thing updating to Python 3.13.1 yesterday. I downgraded to 3.12.8, and Ultisnips is working again.

@SirVer
Copy link
Owner

SirVer commented Feb 17, 2025

Uh... seems like python 3.13 support needs some love. I try to squeeze this in soonish. thanks for the report!

@SirVer
Copy link
Owner

SirVer commented Feb 17, 2025

Though I am not sure if we can do anything about this besides telling people to update their python to a version after the linked commit.

@SirVer
Copy link
Owner

SirVer commented Mar 9, 2025

Alrighty, I spent some time on this today and indeed there is nothing Ultisnips can do about this problem. It is indeed not possible to use Vim with python3 before 9.1.0417; see here: vim/vim#14776

In #1567 I updated the test suite to test only with py13 after this Vim version, so at least the development is not affected, but it does not help users running into this problem. For them the solution is to upgrade to a Vim >= 9.1.0417.

@SirVer SirVer closed this as completed Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants