Google App Engine 本地开发服务器 SSL 警告(Python 2.7)
每次我把我的应用上传到Google App Engine时,日志里总会显示这个警告:
WARNING appengine_rpc.py:435 ssl module not found. Without the ssl
module, the identity of the remote host cannot be verified, and
connections may NOT be secure. To fix this, please install the ssl
module from http://pypi.python.org/pypi/ssl .
我在使用Python 2.7的virtualenv
环境。当我进入这个环境后,我尝试运行
$ pip install ssl
但是这会出现一个错误:
ValueError: This extension should not be used with Python 2.6 or later
(already built in), and has not been tested with Python 2.3.4 or earlier.
如果ssl
模块已经内置在Python 2.7里,那我该怎么告诉本地开发服务器使用这个内置的ssl
模块呢?
1 个回答
1
听起来像是appcfg.py没有正确使用你的虚拟环境。你可以尝试修改appcfg.py这个脚本,让它打印出sys.version和sys.path,这样可以确认它是否在使用你的虚拟环境。(脚本的第一行是"#!/usr/bin/env python",这应该会使用你当前的环境,但检查一下总是好的。)
如果你在使用Launcher,你需要明确告诉它去哪里找你的虚拟环境中的Python。去设置里,设置Python路径为你虚拟环境中的Python 2.7。Launcher会在日志中打印出它正在使用哪个Python路径(至少在启动开发服务器时会显示)。