from __future__ import division
import sys, time, os.path, magic
import atom.data, gdata.client, gdata.docs.client, gdata.docs.data
完整代码在http://planzero.org/blog/2012/04/13/uploading_any_file_to_google_docs_with_python
我在 Virtualbox 上的 Ubuntu 14.04 中工作。我正在使用 Python 2.7.6。我已经成功安装了最新版本的 atom 和 gdata 模块。但是我的代码在导入模块时出现以下错误。
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
我还尝试导入整个 atom 模块。
import atom, gdata.client, gdata.docs.client, gdata.docs.data
出现以下错误:
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
core.py 和 http_core.py 都存在于/usr/local/lib/python2.7/dist-packages/atom/。我尝试直接导入这些模块
import atom.http_core, atom.core
成功了。到底出了什么问题?
请您参考如下方法:
我在尝试安装时遇到了同样的麻烦(Mac OSX 10.10.5,python 版本 2.7.6)。我做了以下
卸载atom(pip uninstall atom)并让
gdata在其setup.py文件中安装pip install tlslite运行
gdata-python-client-master/tests/run_data_tests.py文件
我找到了解决方案 here
