英文:
Go tutorial for Google App Engine: ImportError: No module named _md5
问题
我正在尝试在Go语言中运行Google应用引擎的hello world教程。Go语言的GAE SDK基于Python 2.5,我已经安装了它。然后我需要安装openssl,但是现在当我尝试在SDK上运行我的示例应用程序时,我得到以下错误:
ImportError: No module named _md5
我甚至尝试了在Python解释器界面中简单地导入md5和hashlib,但仍然得到相同的错误:
>>> import hashlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/hashlib.py", line 133, in <module>
md5 = __get_builtin_constructor('md5')
File "/usr/local/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor
import _md5
ImportError: No module named _md5
有人知道如何解决这个问题吗?谢谢!我觉得这个问题实际上与Python的安装有关,而不是其他任何东西。
英文:
I'm trying to run the hello world tutorial for the Google app engine in Go language. The GAE SDK for go is based on python 2.5, which I installed. I then had to install openssl, but now when I try to run my sample application on the SDK, I get the following error:
ImportError: No module named _md5
I even tried a simple import md5 & import hashlib from the python interpreter interface, and i still get the same error
>>> import hashlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/hashlib.py", line 133, in <module>
md5 = __get_builtin_constructor('md5')
File "/usr/local/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor
import _md5
ImportError: No module named _md5
Does anybody know a workaround for this? Thank you!
I have a feeling that this problem is really about python installation than anything else
答案1
得分: 2
你的问题与GAE或SDK无关。我之前也遇到过这个问题。如果你尝试在Ubuntu上安装自定义版本的Python,那么就会遇到这些问题。你应该使用checkinstall卸载自定义的Python。关于此问题的更多详细信息可以在这里找到:https://stackoverflow.com/questions/3544378/uninstall-python-built-from-source。
只需使用默认的Python,一切都会没问题的!
英文:
Your problem has nothing to do with GAE, or the SDK. I have faced this before. If you tried to install your custom version of python (on Ubuntu), then you land up with such issues. You should uninstall the custom python using checkinstall. More details can be found about there here: https://stackoverflow.com/questions/3544378/uninstall-python-built-from-source.
Just use the default python and you'll be fine!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论