Closed jonisb closed 5 years ago
Check that your %PATH% environment variable contains the same set of directories in both cases.
Probably something like C:\Program Files (x86)\Python38-32\lib\site-packages\pywin32_system32
is missing.
Both the plugin and Far have "D:\Python\Python38-32\lib\site-packages\pywin32_system32" in the PATH
I did a print of "sys.path" from the plugin and got this:
['D:\\Python\\Python38-32\\python38.zip', 'D:\\Python\\Python38-32\\Lib', 'D:\\Python\\Python38-32\\DLLs', 'D:\\Program\\Tools\\Far Manager Test', 'D:\\Python\\Python38-32', 'D:\\Python\\Python38-32\\lib\\site-packages', 'D:\\Python\\Python38-
32\\lib\\site-packages\\win32', 'D:\\Python\\Python38-32\\lib\\site-packages\\win32\\lib', 'D:\\Python\\Python38-32\\lib\\site-packages\\Pythonwin']
Seems correct, I get mostly the same using Python directly:
['D:\\Documents\\!Projects\\Experimental\\IndexSearch', 'D:\\Python\\Python38-32\\python38.zip', 'D:\\Python\\Python38-32\\DLLs', 'D:\\Python\\Python38-32\\lib', 'D:\\Python\\Python38-32', 'D:\\Python\\Python38-32\\lib\\site-packages', 'D:\\P
thon\\Python38-32\\lib\\site-packages\\win32', 'D:\\Python\\Python38-32\\lib\\site-packages\\win32\\lib', 'D:\\Python\\Python38-32\\lib\\site-packages\\Pythonwin']
Are you using a Debug or Release version of Pygin?
I found a very similar question - 13 years passed, but it looks like the win32api module still has ABI issues.
Release works fine for me (hi:exec("import pywinauto")
in Far command line gives no errors), while Debug complains about win32api, similar to yours.
I'm using the build from here: https://ci.appveyor.com/project/alabuzhev/evil-programmers/branch/master/job/eeu7ileawj45xbp0/artifacts
Is there another source for a build?
There are no other sources, I'm using the same build.
However, I was using Python 3.7. With a fresh Python 3.8 install I can reproduce your problem, and, moreover, it doesn't work even in Python itself.
I debugged it and it looks like it cannot find pywintypes38.dll. This file is normally located in Lib\site-packages\pywin32_system32, but having that directory in PATH doesn't help for some reason. Once I copied both pythoncom38.dll and pywintypes38.dll to the Python root directory and to the Far root directory it started working everywhere.
Here people have the same problem.
Did you run (as admin) "Python38-32\Scripts\pywin32_postinstall.py"? after that it works in normal Python for me but not via the plugin.
I'll try copying the files and see I get it working, I'll try 3.7 also as I don't really need 3.8 but I didn't have a 32bit version installed when I started working on the plugin.
Thanks for the support.
Edit: Copying the files to the FAR directory works 😋 those files ware in the Python root directory probably from the "pywin32_postinstall.py" script.
As far as I can tell from looking at pywin32_postinstall.py, it copies those dlls to System32 (or SysWOW64) if possible, otherwise - to the Python root directory.
If you see them in the latter - presumably, that script was executed as non-admin initially.
Anyways, good to know that it works now.
Hi, I'm trying to make my first plugin using Pygin on Far 3.0.0.5462 x86 and Python 3.8-32.
I'm trying to import pywinauto and getting this error:
My code works when not using Pygin but running in Far using Python 3.8-32 directly.
The Hello world example plugin works, so I assume I installed Pygin correctly.