How to install Python ssl module on Windows?

前端 未结 5 1352
一个人的身影
一个人的身影 2020-12-07 23:26

The Google App Engine Launcher tells me:

WARNING appengine_rpc.py:399 ssl module not found. Without the ssl module, the identity of the remote host canno

5条回答
  •  失恋的感觉
    2020-12-07 23:44

    I had to use the following modification of AndiDog's approach:

    setup.py build -cmingw32
    setup.py install --skip-build
    

    Without the --skip-build option, the install would try to build again and complain about MSVC again:

    error: Python was built with Visual Studio 2003;
    extensions must be built with a compiler than can generate compatible binaries.
    Visual Studio 2003 was not found on this system. If you have Cygwin installed,
    you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
    

    Also, initially when using the build command I had a lot of errors like this:

    build\temp.win32-2.5\Release\ssl\_ssl2.o:_ssl2.c:(.text+0x1d): undefined reference to `_imp__PyImport_ImportModule'
    build\temp.win32-2.5\Release\ssl\_ssl2.o:_ssl2.c:(.text+0x34): undefined reference to `_imp__PyObject_GetAttrString'
    build\temp.win32-2.5\Release\ssl\_ssl2.o:_ssl2.c:(.text+0x53): undefined reference to `_imp__PyCObject_AsVoidPtr'
    

    This was because I had originally installed the 64bit version of Python 2.5.4 (python-2.5.4.amd64.msi). I removed that and installed the 32bit version (python-2.5.4.msi). This includes the libpython25.a file which the build command was looking for.

提交回复
热议问题