davidhalter / jedi

Awesome autocompletion, static analysis and refactoring library for python
http://jedi.readthedocs.io
Other
5.73k stars 503 forks source link

`PathFinder` has no attribute `find_module` in `python 12.2` #1985

Closed zeionara closed 4 months ago

zeionara commented 4 months ago

Have the following error in environment with python=3.12.2 with the latest version of jedi (0.19.1) when running python-lsp-server:

lib/python3.12/site-packages/jedi/inference/compiled/subprocess/functions.py\", line 166, in _find_module_py33
    loader = loader or importlib.machinery.PathFinder.find_module(string, path)
                       ^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'PathFinder' has no attribute 'find_module'

The error appears when analyzing import statements like

from click import argument

However, on lines like

import click

everything works fine

davidhalter commented 4 months ago

I'm pretty sure you don't actually use Jedi v0.19.1, because the string find_module doesn't exist in the module you mentioned (we are using fine_spec now) and also the line 166 does not match up with anything you mentioned.

I'm closing, because I don't think this is an issue (3.12 is tested in the CI as well). However feel free to respond and I'm happy to help where I can.

zeionara commented 4 months ago

I'm pretty sure you don't actually use Jedi v0.19.1, because the string find_module doesn't exist in the module you mentioned (we are using fine_spec now) and also the line 166 does not match up with anything you mentioned.

I'm closing, because I don't think this is an issue (3.12 is tested in the CI as well). However feel free to respond and I'm happy to help where I can.

Yeah, thanks. I've solved the problem by reinstalling python-lsp-server:

conda uninstall jedi
conda install python-lsp-server
conda install jedi

pip install -U jedi
pip install -U astroid