Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nosetest and Google API: "no module named apiclient.discovery"

I'm trying to nosetest my little Python script that uses the Google Translate API.
Where do I have to install the API or what do I have to do so nosetest stops telling me

ImportError: No module named apiclient.discovery

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.

Any help would be greatly appreciated! :)

like image 290
LukasKawerau Avatar asked Dec 17 '12 17:12

LukasKawerau


2 Answers

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.

like image 121
Games Brainiac Avatar answered Nov 14 '22 10:11

Games Brainiac


Here I think you can download the tar.gz file at https://pypi.python.org/pypi/apiclient/1.0.2. unpack it and have it installed on your PC.

like image 21
lonelyjohner Avatar answered Nov 14 '22 10:11

lonelyjohner