谷歌应用引擎的Go教程:导入错误:找不到模块名为_md5。

huangapple go评论102阅读模式
英文:

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

&gt;&gt;&gt; import hashlib
Traceback (most recent call last):
File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
File &quot;/usr/local/lib/python2.5/hashlib.py&quot;, line 133, in &lt;module&gt;
md5 = __get_builtin_constructor(&#39;md5&#39;)
File &quot;/usr/local/lib/python2.5/hashlib.py&quot;, 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!

huangapple
  • 本文由 发表于 2012年4月25日 05:36:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/10306361.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定