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 installer told me it added python to the path.