回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<pre><code>from __future__ import division
import sys, time, os.path, magic
import atom.data, gdata.client, gdata.docs.client, gdata.docs.data
</code></pre>
<p>完整的代码在<a href="http://planzero.org/blog/2012/04/13/uploading_any_file_to_google_docs_with_python" rel="nofollow">http://planzero.org/blog/2012/04/13/uploading_any_file_to_google_docs_with_python</a></p>
<p>我在Ubuntu 14.04工作,开发virtualbox。我正在使用Python2.7.6。我已经用最新版本成功地安装了atom和gdata模块。但是在导入模块时,我的代码给出了以下错误。</p>
<pre><code>Traceback (most recent call last):
File "test14.py", line 16, in <module>
import atom.data, gdata.client, gdata.docs.client, gdata.docs.data
File "/usr/local/lib/python2.7/dist-packages/atom/data.py", line 24, in <module>
import atom.core
ImportError: No module named core
</code></pre>
<hr/>
<p>我还尝试导入整个atom模块。</p>
<pre><code>import atom, gdata.client, gdata.docs.client, gdata.docs.data
</code></pre>
<p>出现以下错误:</p>
<pre><code>Traceback (most recent call last):
File "test14.py", line 16, in <module>
import atom, gdata.client, gdata.docs.client, gdata.docs.data
File "/usr/local/lib/python2.7/dist-packages/gdata/client.py", line 35, in <module>
import atom.client
File "/usr/local/lib/python2.7/dist-packages/atom/client.py", line 27, in <module>
import atom.http_core
ImportError: No module named http_core
</code></pre>
<p>core.py和http_core.py都位于/usr/local/lib/python2.7/dist packages/atom/。我试着直接导入这些模块</p>
<pre><code>import atom.http_core, atom.core
</code></pre>
<p>成功了。那出什么事了?</p>