How to Make a PyMe (Python library) Run in Python

2019-08-23 01:42发布

问题:

I want to run this library on Python 2.4 in Windows XP.

I installed the pygpgme-0.8.1.win32.exe file but got this:

>>> from pyme import core
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\Python24\Lib\site-packages\pyme\core.py", line 22, in ?
    import pygpgme
  File "C:\Python24\Lib\site-packages\pyme\pygpgme.py", line 7, in ?
    import _pygpgme
ImportError: DLL load failed: The specified module could not be found.

And then this pop up comes up

---------------------------
python.exe - Unable To Locate Component
---------------------------
This application has failed to start because python25.dll was not found. Re-installing the application may fix this problem.
---------------------------
OK  

Do I need to "compile" it for Python 2.4? How do I do that?

回答1:

While the pygpgme project does not clearly document it, it's clear from the error message you got that their .win32.exe was indeed compiled for Python 2.5.

To compile their code for Python 2.4 (assuming they support that release!), download their sources, unpack them, open a command window, cd to the directory you unpacked their sources in, and run python setup.py install. This will probably not work unless you have the right Microsoft C compiler installed (MSVC 6.0 if I recall correctly).

It's no doubt going to be much less trouble to download, install and use Python 2.5 for Windows (it can perfectly well coexist with your current 2.4, no need to remove that). Is that a problem?