I found a lot of questions about it, some problem was about 32 or 64 bit, other was about python support compiled in vim, etc.
None was my case.
Preamble: Software installed
I installed Python on Windows10. The official installer suggested me (as default choice) the installation for current user; it is then installed in: c:\Users\USERNAME\AppData\Local\Programs\Python\Python310\
I installed Vim for Windows from the win-32 installer site and I installed 64 bit version with Python support.
If I type :version
, I see +python/dyn
and +python3/dyn
.
On "Python side", if I check from Windows terminal:
C:\>python
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32
Then there's compiled-in support and there's architecture concordance, and all works.
Now if I launch gvim from start menu, or from the "right-click" menu it works fine. I mean if I execute, in command mode,
:py3 import sys;print(sys.version)
Vim says:
3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
Then all plugins that requires Python (for example Voom) works fine. Even when you start Vim from Explorer or from the Total Commander toolbar, either by clicking on the gvim.exe button or by dragging a file onto the button in the toolbar, everything works as expected.
(Total Commander button setup)
Problem
Then there's my problem. I use Joplin to take notes and I can set up an external editor. I use gvim, obviously. :-)
But when the gvim starts from it the python library isn't loaded, i.e. if I execute:
:py3 import sys;print(sys.version)
vim says:
E370: Non riesco a caricare la libreria : Parametro non corretto.
E263: Spiacente, comando non disponibile, non riesco a caricare libreria programmi Python.
Premi INVIO o un comando per proseguire
I tried to inform vim about the python path and dll, by this commands:
:set pythonthreedll="c:\Users\USERNAME\AppData\Local\Programs\Python\Python310\python310.dll
:set pythonthreehome="c:\Users\USERNAME\AppData\Local\Programs\Python\Python310\
:let $PYTHONPATH = "c:\Users\USERNAME\AppData\Local\Programs\Python\Python310"
None of this helped me. 70 / 5.000 Risultati della traduzione I don't know if the dlls are loaded at run-time or when gvim starts.
The only solution I found was to copy python310.dll into the vim folder. Then it works.
Why?
How to solve it without copying the dll?
Thanks
[UPDATE]
After the Vivian's reply I double checked all about the PATH.
The problem is actually in the PATH environment variable, but but I can't figure out what's going on.
The installer told me it added python to the path.
This is consistent with the fact that I can launch python from the command prompt. Confirmation also comes from checking the PATH variable.
The control panel also sees the variables correctly.
Unfortunately it’s only Vim that doesn’t notice that Python is in the PATH.
But if I do, in command mode:
:let $PATH .= ';c:\Users\PAOLINIA\AppData\Local\Programs\Python\Python310'
then Gvim instance loads the Python dlls correctly.
path
environment variable. To verify that run the the Vim command:echo $path
. If Python 10 is not part of it I recommend to restart the custom explorer or to start gVim from Windows explorer (or reboot ;-) )