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

Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when working with Numpy 1.23 #243

Closed
jhossbach opened this issue Jul 11, 2022 · 6 comments · Fixed by #281
Assignees
Milestone

Comments

@jhossbach
Copy link
Member

Hey,
I am currently getting the error Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when I import numpy and try to trigger autocompletion. I think as a result I don't receive any autocompletion options for numpy, but for any submodules such as numpy.testing this works again.
I am not sure how to debug this, any ideas are welcome. My pylsp version is v1.4.1, I am using neovim v0.8.0-dev+595-g95c65a6b22. As config option I pass

	pylsp = {
	    configurationSources = { "flake8" },
	    plugins = {
		pyflakes = {enabled = false},
		pylint = {enabled = false},
		yapf = {enabled = false},
		black = {enabled = true},
		flake8 = {enabled = true},
		pycodestyle = {enabled = false},
		mccabe = {enabled = false},
		pydocstyle = {enabled = true},
	    }
	}

to pylsp.

@ccordoba12
Copy link
Member

Hey @jhossbach, thanks for reporting. I guess you're using Numpy 1.23, right? If that's the case, please downgrade to 1.22 and try again. That should fix your problem for now.

@ccordoba12 ccordoba12 added this to the v1.5.1 milestone Jul 11, 2022
@ccordoba12 ccordoba12 self-assigned this Jul 11, 2022
@ccordoba12 ccordoba12 changed the title Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when working with Numpy Jul 11, 2022
@ccordoba12 ccordoba12 changed the title Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when working with Numpy Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when working with Numpy Jul 11, 2022
@jhossbach
Copy link
Member Author

This works indeed, may I ask why that is?

@ccordoba12
Copy link
Member

We don't know yet. We just noticed that our tests started to fail as soon as Numpy 1.23 was released.

@ccordoba12 ccordoba12 changed the title Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when working with Numpy Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'type' when working with Numpy 1.23 Jul 11, 2022
@jhossbach
Copy link
Member Author

Hmm, that is weird indeed, thanks for the quick reply!

@ccordoba12
Copy link
Member

Note: This is a bug in Jedi, see davidhalter/jedi#1864.

@ccordoba12 ccordoba12 added this to the v1.6.0 milestone Nov 1, 2022
@ccordoba12
Copy link
Member

This will be solved in the next PyLSP version by directly importing Numpy to provide completions.

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

Successfully merging a pull request may close this issue.

2 participants