<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
我关注了this当 cd
到 build\lib.win32-2.5
时,我一步一步地导入成功。
如何在其他文件夹运行python
时导入成功?
最佳答案
编辑:关于您得到的错误cannot find -lgw32c
,您只需下载libgw32c ,在您的 step by step guide 的依赖项列表中提到
=> 开发者版本!! (不是二进制文件,也不是源代码)
我也试过用mingw32编译
D:\tmp\ssl-1.15> python setup.py build -c mingw32
running build
running build_py
running build_ext
building 'ssl._ssl2' extension
writing build\temp.win32-2.5\Release\ssl\_ssl2.def
gcc.exe -mno-cygwin -shared -s build\temp.win32-2.5\Release\ssl\_ssl2.o build\temp.win32-2.5\Release\ssl\_ssl2.def -LC:\Utils\GnuWin32\lib -LD:\Python25\libs -LD:\Python25\PCBuild -lssl -lcrypto -lwsock32 -lgdi32 -lgw32c -lole32 -luuid -lpython25 -lmsvcr71 -o build\lib.win32-2.5\ssl\_ssl2.pyd -static
D:\tmp\ssl-1.15>
导入正常
D:\tmp\ssl-1.15\build\lib.win32-2.5> python
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> dir(ssl)
['CERT_NONE', 'CERT_OPTIONAL', 'CERT_REQUIRED', 'DER_cert_to_PEM_cert', 'PEM_FOOTER', 'PEM_HEADER', 'PEM_cert_to_DER_cert', 'PROTOCOL_NOSSLv2', 'PROTOCOL_SSLv2', 'PROTOCOL_SSLv23', 'PROTOCOL_SSLv3', 'PROTOCOL_TLSv1', 'RAND_add', 'RAND_egd', 'RAND_status', 'SSLError', 'SSLSocket', 'SSL_ERROR_EOF', 'SSL_ERROR_INVALID_ERROR_CODE', 'SSL_ERROR_SSL', 'SSL_ERROR_SYSCALL', 'SSL_ERROR_WANT_CONNECT', 'SSL_ERROR_WANT_READ', 'SSL_ERROR_WANT_WRITE', 'SSL_ERROR_WANT_X509_LOOKUP', 'SSL_ERROR_ZERO_RETURN', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '_fileobject', '_getnameinfo', '_ssl2', 'base64', 'cert_time_to_seconds', 'get_protocol_name', 'get_server_certificate', 'os', 'select', 'socket', 'sslwrap_simple', 'sys', 'wrap_socket']
>>>
更新:针对第二个问题
my new problem is : how to import it successful when i run 'python' on other dirs?
在我的例子中,我只做了python setup.py build -c mingw32
,你需要使用安装
python setup.py install
或
只需将 ssl
文件夹从 build\lib.win32-2.5
复制到 D:\Python25\Lib\site-packages\
关于google-app-engine - 如何为 google-app-engine 设置 SSL 模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2688553/
相关文章:
google-app-engine - App Engine 默认凭据在删除后恢复(+ 30 天)
javascript - 将数据从 HTTPS 页面发送到本地主机服务器
java - 使用相同的 SSL Key/TrustStore 分发客户端/服务器应用程序是否安全?
ruby-on-rails - 默认情况下,如何在 Rails 中使 cookie 安全(仅限 https)?
javascript - 无法从 Chrome 扩展访问端点 API
android - Google Cloud Save 是否已整合到游戏服务中?