8

我正在尝试测试我使用 Google Translate API 的小 Python 脚本。
我必须在哪里安装 API 或者我必须做什么才能使nosetest 停止告诉我

ImportError: No module named apiclient.discovery

该脚本运行良好,我按照您的方式导入它并使用 pip 安装它,但我找不到任何有关如何使用nosetest 使其工作的信息。

任何帮助将不胜感激!:)

4

2 回答 2

1

The script runs fine, I import it as you would and installed it with pip, but I can't find any info on how to make this work with nosetest.

GAE does not work with pip very well unfortunately. I've encountered a similar problem like this.

What you need to do is copy the modules from your Python's libraries or you can just download them again from their websites, and then paste them directly inside your GAE code. Often, developers create a folder called lib, and add it PYTHONPATH.

Then your nosetests should run.

于 2013-10-21T12:26:40.170 回答
1

在这里,我认为您可以在https://pypi.python.org/pypi/apiclient/1.0.2下载 tar.gz 文件。将其解压缩并安装在您的 PC 上。

于 2014-02-28T13:48:41.680 回答