Closed idbrii closed 1 year ago
Ahh, yes, I saw this one too. My mapleader plugin complains about it. I thought I missed something in upgrading my local instal of Python from 3.10 to 3.11.1 But, there was a similar problem going from 3.10 to 3.11.0. (ie. also related to path variables) python partially resolved the issue in Python 3.11.1. but it looks like there are still some related issues in python 3.11.1
I think there is a security footprint that they are trying to minimize with respect to dynamic dlls.
Same problem here Importing almost all python modules gives an error message in 3.11.1 (ModuleNotFoundError). No problems in 3.11
tried idbrii's solution without success (I'm on win11)
Same problem for me, and idbrii's solution (pythonthreehome) fixes the issue. This might be worth investigating.
Same problem for me, and idbrii's solution (pythonthreehome) fixes the issue. This might be worth investigating.
What did you do to make it work? idbrii's solution didn't work.
What are you default values? set pythonthreedll? pythonthreehome?
update: Python 3.11.2 resolves the problem
update: Python 3.11.2 resolves the problem
Then, I think we can close this.
Steps to reproduce
On gvim 9.0.1205,
:py3 import socket
produces an error::!python import socket
completes successfully.However, it doesn't error on gvim_9.0.0844_x64 (the last version using python310.dll). The next version is gvim_9.0.0845_x64 which fails just like 9.0.1205. So it seems that something has failed in upgrading python 3.10 -> 3.11.
Setting 'pythonthreehome' fixes the issue, but it seems like something broke since that was previously not necessary.
I don't have PYTHONHOME or PYTHONPATH environment variables set. Before this issue, the registry file that scoop generates was enough for vim to find everything that python needs (see pep-0514).
More Details
_socket
is apparently a C module, so I guess it needs to be found in the python dll?Issue #2840 looked related (except I'm not using miniconda and I'm on Windows), so I tried the suggestions of setting pythonthreedll, clearing the pythonthree settings, and then setting pythonthreehome and only that last one worked:
The default values on my system:
pythonthreehome has existed for a long time (since 94073167e3aa8cbe18380e93a2fc8e8165438cc8), but did something else change?
Expected behaviour
Module imports without error.
Version of Vim
9.0.1205
Environment
gvim 64 bit Windows 10
The shell and vim python versions match and I only have one version of py3.11 installed:
:py3 import sys; print(sys.version)
3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]:!python import sys; print(sys.version)
3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]I'm using zip builds from vim-win32-installer and official python builds installed by scoop (specifically python311). Ran the .reg so python is hooked up in the registry and lots of python functionality works fine in vim except for this module.
Logs and stack traces