简体   繁体   English

无法导入google.appengine.api

[英]can't import google.appengine.api

This should be pretty basic as I've installed lots of python packages, but I can't for the life of my get google apis client library for python to install. 这应该是非常基本的,因为我已经安装了许多python包,但我不能为我的get google apis客户端库安装python。

I'm pressure sure I've gone through the instructions on this website properly: https://developers.google.com/api-client-library/python/start/installation 我很有压力确定我已正确浏览了本网站上的说明: https//developers.google.com/api-client-library/python/start/installation

To summarize I've done the following: 总结一下,我做了以下事情:

$ easy_install --upgrade google-api-python-client $ easy_install --upgrade google-api-python-client

this seems to work fine, doesn't report any errors or warnings 这似乎工作正常,不报告任何错误或警告

downloaded and unzipped google-api-python-client-gae-1.2.zip into the directory where my project is 将google-api-python-client-gae-1.2.zip下载并解压缩到我的项目所在的目录中

but if I open an iPython session in the folder where I unpacked the full dependencies I can't do the basic imports such as: 但如果我在解压缩完整依赖项的文件夹中打开一个iPython会话,我就无法执行基本导入,例如:

import google.appengine.api it just says "No Module named google.appengine.api" 导入google.appengine.api它只是说“没有名为google.appengine.api的模块”

I checked in my site-packages folder and google_api_python_client-1.2-py2.7.egg is there. 我检查了我的site-packages文件夹,google_api_python_client-1.2-py2.7.egg就在那里。 But it doesn't show up in sys.path 但它没有出现在sys.path中

when I do sys.path.append('C:\\Anaconda\\Lib\\site-packages\\google_api_python_cli ent-1.2-py2.7.egg') it adds the correct path, but the import still doesn't work. 当我执行sys.path.append('C:\\ Anaconda \\ Lib \\ site-packages \\ google_api_python_cli ent-1.2-py2.7.egg')时,它会添加正确的路径,但导入仍然无效。

EDIT: This fixed my problem 编辑:这解决了我的问题

Adding the Google SDK to my Python path did the trick. 将Google SDK添加到我的Python路径就可以了。 I don't know why the installer didn't do this when I ran it. 我不知道为什么安装程序在运行时没有这样做。 but hey, this worked 但是嘿,这很有效

So if I run: 所以,如果我跑:

sys.path.append('C:\\Program Files (x86)\\Google\\google_appengine')

from google.appengine import api

works! 作品!

Without knowing all the steps you took to install app engine and the client APIs, my only recommendation is to install (or reinstall) the Google App Engine Python SDK from here: https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python . 在不知道您为安装应用引擎和客户端API所采取的所有步骤的情况下,我唯一的建议是从此处安装(或重新安装)Google App Engine Python SDK: https//developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python Looks like you're on windows, so you would grab the MSI. 看起来你在Windows上,所以你会抓住MSI。

Just make sure you launch the AppEngineLauncher application after installation as it will give you the option to create symlinks so you can run commands from terminal. 只需确保在安装后启动AppEngineLauncher应用程序,因为它将为您提供创建符号链接的选项,以便您可以从终端运行命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在python flex环境中导入错误google.appengine.api - Import error google.appengine.api in python flex environment import cloudstorage,ImportError:没有名为google.appengine.api的模块 - import cloudstorage, ImportError: No module named google.appengine.api ImportError:没有名为google.appengine.api的模块 - ImportError: No module named google.appengine.api Visual Code pylint:无法导入 webapp2 和 google.appengine.api - Visual Code pylint: unable to import webapp2 and google.appengine.api 升级到 GAE3 时替换 google.appengine.api 导入模块 - Replacing google.appengine.api import modules when upgrading to GAE3 尝试从google.appengine.api中导入background_thread(例如示例)失败,并出现ImportError - Trying to Import background_thread from google.appengine.api (like in example) fails with ImportError 在 Ubuntu 18.04 中找不到 Python google.appengine.api - Python google.appengine.api not found in Ubuntu 18.04 在不使用dev_appserver.py的情况下从google.appengine.api导入memcache - Importing memcache from google.appengine.api without using dev_appserver.py 无法导入appengine python模块 - Can't import appengine python module 无法访问Google AppEngine外部库 - Can't access Google AppEngine external libraries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM