我正在设置一台新的开发机器并安装了我的IDE pycharm。我安装了python到C:\Program (x86)\python27
。但是,当我启动我的gae服务器时,我得到了这个追溯。这是什么意思?
pydev debugger: process 7576 is connecting
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.3\helpers\pydev\pydevd.py", line 2358, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.3\helpers\pydev\pydevd.py", line 1778, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 83, in <module>
_run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py", line 175, in <module>
main()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py", line 155, in main
sandbox.enable_sandbox(config)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 189, in enable_sandbox
from google.appengine.runtime import runtime
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\runtime.py", line 40, in <module>
from google.appengine.runtime import cgi
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\cgi.py", line 32, in <module>
from email import feedparser
File "C:\Program Files (x86)\python27\lib\email\feedparser.py", line 27, in <module>
from email import message
File "C:\Program Files (x86)\python27\lib\email\message.py", line 16, in <module>
import email.charset
File "C:\Program Files (x86)\python27\lib\email\charset.py", line 13, in <module>
import email.base64mime
File "C:\Program Files (x86)\python27\lib\email\base64mime.py", line 40, in <module>
from email.utils import fix_eols
File "C:\Program Files (x86)\python27\lib\email\utils.py", line 28, in <module>
import socket
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 829, in load_module
return self.import_stub_module(fullname)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 841, in import_stub_module
__import__(fullname, {}, {})
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist27\socket.py", line 73, in <module>
from _ssl import RAND_add, RAND_egd, RAND_status, SSL_ERROR_ZERO_RETURN, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE, SSL_ERROR_WANT_X509_LOOKUP, SSL_ERROR_SYSCALL, SSL_ERROR_SSL, SSL_ERROR_WANT_CONNECT, SSL_ERROR_EOF, SSL_ERROR_INVALID_ERROR_CODE
ImportError: cannot import name RAND_egd
pydev debugger: process 2496 is connecting
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.3\helpers\pydev\pydevd.py", line 2358, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files (x86)\JetBrains\PyCharm 4.5.3\helpers\pydev\pydevd.py", line 1778, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 83, in <module>
_run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py", line 175, in <module>
main()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py", line 155, in main
sandbox.enable_sandbox(config)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 189, in enable_sandbox
from google.appengine.runtime import runtime
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\runtime.py", line 40, in <module>
from google.appengine.runtime import cgi
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\cgi.py", line 32, in <module>
from email import feedparser
File "C:\Program Files (x86)\python27\lib\email\feedparser.py", line 27, in <module>
from email import message
File "C:\Program Files (x86)\python27\lib\email\message.py", line 16, in <module>
import email.charset
File "C:\Program Files (x86)\python27\lib\email\charset.py", line 13, in <module>
import email.base64mime
File "C:\Program Files (x86)\python27\lib\email\base64mime.py", line 40, in <module>
from email.utils import fix_eols
File "C:\Program Files (x86)\python27\lib\email\utils.py", line 28, in <module>
import socket
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 829, in load_module
return self.import_stub_module(fullname)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py", line 841, in import_stub_module
__import__(fullname, {}, {})
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist27\socket.py", line 73, in <module>
from _ssl import RAND_add, RAND_egd, RAND_status, SSL_ERROR_ZERO_RETURN, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE, SSL_ERROR_WANT_X509_LOOKUP, SSL_ERROR_SYSCALL, SSL_ERROR_SSL, SSL_ERROR_WANT_CONNECT, SSL_ERROR_EOF, SSL_ERROR_INVALID_ERROR_CODE
ImportError: cannot import name RAND_egd
如果我以管理员pip install PyOpenSLL
的身份运行,那么我就会
C:\>pip install pyopensll
Collecting pyopensll
Could not find a version that satisfies the requirement pyopensll (from versio
ns: )
No matching distribution found for pyopensll
C:\>pip install pyOpenSSL
Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL in c:\progra
m files (x86)\python27\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): six>=1.5.2 in c:\progr
am files (x86)\python27\lib\site-packages (from pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): cryptography>=0.7 in c
:\program files (x86)\python27\lib\site-packages (from pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\progr
am files (x86)\python27\lib\site-packages (from cryptography>=0.7->pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): enum34 in c:\program f
iles (x86)\python27\lib\site-packages (from cryptography>=0.7->pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): pyasn1 in c:\program f
iles (x86)\python27\lib\site-packages (from cryptography>=0.7->pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): idna in c:\program fil
es (x86)\python27\lib\site-packages (from cryptography>=0.7->pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in c:\progra
m files (x86)\python27\lib\site-packages (from cryptography>=0.7->pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): cffi>=0.8 in c:\progra
m files (x86)\python27\lib\site-packages (from cryptography>=0.7->pyOpenSSL)
Requirement already satisfied (use --upgrade to upgrade): pycparser in c:\progra
m files (x86)\python27\lib\site-packages (from cffi>=0.8->cryptography>=0.7->pyO
penSSL)
C:\>
答案 0 :(得分:4)
目前,公开发布列表中没有任何提及RAND_egd的错误。我建议filing a bug针对此问题,包括堆栈跟踪,并提及您在Windows 8.1上看到此问题。包含指向此stackoverflow问题的链接。
这仍然会给您带来直接问题,因此请考虑尝试此实验:编辑google_appengine\google\appengine\dist27\socket.py
并删除对RAND_egd的引用(将原始行的副本注释掉,或者复制socket.py,这样你就可以轻松恢复变化了。然后看看会发生什么。你可能会很幸运。请报告回来。
答案 1 :(得分:3)
新:
您似乎使用LibreSSl而不是OpenSSL。见Python: Issue 21356
通过在python-shell中运行它来检查你是否正在使用LibreSSL:
from ssl import OPENSSL_VERSION; print OPENSSL_VERSION
旧:
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist27\socket.py", line 73, in <module>
from _ssl import RAND_add, RAND_egd, RAND_status, SSL_ERROR_ZERO_RETURN, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE, SSL_ERROR_WANT_X509_LOOKUP, SSL_ERROR_SYSCALL, SSL_ERROR_SSL, SSL_ERROR_WANT_CONNECT, SSL_ERROR_EOF, SSL_ERROR_INVALID_ERROR_CODE
ImportError: cannot import name RAND_egd
是您必须知道的。非常简单的写作,这意味着: “Google的应用引擎无法在模块_ssl中找到名为RAND_egd的名称”
尝试更新所有包。
从控制台尝试from _ssl Import RAND_egd
,然后将结果放在此处。