I have recently updated my environment using gcloud component update. I am now having the following issue:
xxxxxx-MacBook-Air:~ poiuytrez$ dev_appserver.py .
Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 36, in <module>
from google.appengine.tools.devappserver2 import dispatcher
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 29, in <module>
from google.appengine.tools.devappserver2 import module
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 75, in <module>
from google.appengine.tools.devappserver2 import vm_runtime_factory
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/devappserver2/vm_runtime_factory.py", line 25, in <module>
from google.appengine.tools.devappserver2 import vm_runtime_proxy
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/devappserver2/vm_runtime_proxy.py", line 29, in <module>
from google.appengine.tools.devappserver2 import log_manager
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/devappserver2/log_manager.py", line 34, in <module>
from google.appengine.tools.docker import containers
File "/Applications/Miscelaneous/google-cloud-sdk/.install/.backup/platform/google_appengine/google/appengine/tools/docker/containers.py", line 48, in <module>
from docker import docker
ImportError: cannot import name docker
I am not sure what to do.
As per Google Cloud SDK - Release Notes for 0.9.68 (2015/07/08)
The standalone App Engine SDKs are no longer distributed through the Cloud SDK.
App Engine functionality can still be used through the gcloud preview app command group.
The gae-java, gae-python, gae-php, and gae-go components no longer exist in the component manager.
If you need to use appcfg or dev_appserver directly, these are still
available in the App Engine SDK downloads that can be found here:
https://cloud.google.com/appengine/downloads
So your options are:
Run gcloud preview app run app.yaml from your project's home directory
Install the Google App Engine SDK for python and use its bundled dev_appserver
Install docker-py to "fix" it.
More info in this bug report
Related
I am trying to use the Human Api Python client with GAE.
I created a appengine_config.py and followed all instructions as described in Third-party Libraries in Python 2.7 documentation for GAE
My appengine_config.py looks like:
"""This file is loaded when starting a new application instance."""
from google.appengine.ext import vendor
# Add any libraries installed in the "lib" folder.
vendor.add('lib')
My requirements.txt looks like so:
HumanAPI
... and installs correctly:
Downloading/unpacking HumanAPI (from -r requirements.txt (line 1))
Downloading humanapi-0.1.10.tar.gz
Running setup.py (path:/private/var/folders/yq/s_1v2vtn2sxbtw_gz00q1r5w0000gp/T/pip_build_jimmykane/HumanAPI/setup.py) egg_info for package HumanAPI
Downloading/unpacking requests>=0.13.2 (from HumanAPI->-r requirements.txt (line 1))
Downloading requests-2.6.0-py2.py3-none-any.whl (469kB): 469kB downloaded
Downloading/unpacking docopt==0.4.0 (from HumanAPI->-r requirements.txt (line 1))
Downloading docopt-0.4.0.tar.gz
Running setup.py (path:/private/var/folders/yq/s_1v2vtn2sxbtw_gz00q1r5w0000gp/T/pip_build_jimmykane/docopt/setup.py) egg_info for package docopt
Installing collected packages: HumanAPI, requests, docopt
Running setup.py install for HumanAPI
Running setup.py install for docopt
Successfully installed HumanAPI requests docopt
Cleaning up...
But when I try to import:
from humanapi import get_authorize_url, get_auth_session
I get:
ERROR 2015-03-27 13:18:05,023 wsgi.py:263]
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/main.py", line 2, in <module>
from controllers import server, auth, metrics
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/controllers/auth.py", line 9, in <module>
from humanapi import get_authorize_url, get_auth_session
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/humanapi/__init__.py", line 1, in <module>
from .api import *
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/humanapi/api.py", line 1, in <module>
import requests, os.path, logging, sys, time
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/__init__.py", line 58, in <module>
from . import utils
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/utils.py", line 26, in <module>
from .compat import parse_http_list as _parse_list_header
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/compat.py", line 42, in <module>
from .packages.urllib3.packages.ordered_dict import OrderedDict
File "/Users/jimmykane/projects/dimitrioskanellopoulos.com/lib/requests/packages/__init__.py", line 95, in load_module
raise ImportError("No module named '%s'" % (name,))
PIP version is 6.0.8
Anyone to help me solving this dependancy thingy or guide me to what I am doing wrong?
Thanks
I followed the tutorial from google here: https://console.developers.google.com/start/appengine
After what I tried started the demo application and got the following error:
$ goapp serve appengine-try-go
Traceback (most recent call last):
File "/home/nek/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/home/nek/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 36, in <module>
from google.appengine.tools.devappserver2 import dispatcher
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 29, in <module>
from google.appengine.tools.devappserver2 import module
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 71, in <module>
from google.appengine.tools.devappserver2 import vm_runtime_factory
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/vm_runtime_factory.py", line 25, in <module>
from google.appengine.tools.devappserver2 import vm_runtime_proxy
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/vm_runtime_proxy.py", line 29, in <module>
from google.appengine.tools.devappserver2 import log_manager
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/log_manager.py", line 34, in <module>
from google.appengine.tools.docker import containers
File "/home/nek/google-cloud-sdk/platform/google_appengine/google/appengine/tools/docker/containers.py", line 47, in <module>
import docker
ImportError: No module named docker
error while running dev_appserver.py: exit status 1
I'm using it on Ubuntu 14.04 with zsh and python 2.7.6.
Does somebody understand why ?
After installed pip, I executed the following command:
sudo pip install docker-py
Now it works.
I have been using Google App Engine Launcher many times and it worked perfect but recently I used it and I had this Error:
2014-01-02 18:50:58 Running command: "[u'C:\\Python27\\python.exe', '-u', u'C:\\Program Files (x86)\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'--email=[my email]', '--passin', 'update', u'D:\\temp\\my-aiesec']"
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 196, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 192, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 81, in <module>
from google.appengine.tools import bulkloader
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\bulkloader.py", line 128, in <module>
from google.appengine.ext.bulkload import bulkloader_config
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\bulkload\bulkloader_config.py", line 47, in <module>
from google.appengine.ext.bulkload import simplexml_connector
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\bulkload\simplexml_connector.py", line 40, in <module>
from xml.etree import cElementTree as ElementTree
File "C:\Python27\Lib\xml\etree\cElementTree.py", line 3, in <module>
from _elementtree import *
AttributeError: 'module' object has no attribute 'expat_CAPI'
2014-01-02 18:50:59 (Process exited with code 1)
You can close this window now.
1- First I thought the version of my GAE is out dated. so I upgrade to newest version 1.8.8.
2- I set the python 2.7 path in preferences.
3- I created a new project and launched it locally and it worked.
But still I had this deploying problem.
Previously I defined PYTHONPATH in the Environment Variables (System Variables) of my windows. I removed that Variable and Google App Engine worked again.
Google App Engine Launcher suddenly not working when running any app, it works well yesterday.
Error produced:
wi2013-01-15 14:56:52 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--admin_console_server=', '--port=8080', 'C:\\Users\\Lawrence\\Documents\\guestbook-2']"
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 171, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 167, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 166, in <module>
from google.appengine.tools import appcfg
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 41, in <module>
import mimetypes
File "C:\Python27\Lib\mimetypes.py", line 29, in <module>
import urllib
File "C:\Python27\Lib\urllib.py", line 26, in <module>
import socket
File "C:\Python27\Lib\socket.py", line 47, in <module>
import _socket
ImportError: Module use of python25.dll conflict with this version of Python.
2013-01-15 14:56:52 (Process exited with code 1)
When you google this error, a lot of solution telling you to change the
System/ User Environment Variable to add C:\Python27;C:\Python27\Scripts; C:\Python27\Lib; C:\Python27\libs; etc, remove or add User Variable etc. All those trick not work for me.
I didn't install python25. Those programme refer to it and using import _socket are google app engine launcher itself or Google Drive, I have stopped my Google Drive already as people found this may cause problem. so I guess this GAE conflicted itself when some error happen inside it. The clue is I got another error in google app launcher log,C:\Program Files (x86)\Google\google_appengine\launcher\GoogleAppEngineLauncher.exe.log
I'm using win 7 64 bits, GAE 1.7.4, Python 2.7.3
You need to edit app.yaml
you should have:
runtime: python
replace with:
runtime: python27
threadsafe: true
Pay attention to threadsafe:
https://developers.google.com/appengine/docs/python/python25/migrate27#threadsafe
Other setting of app.yaml
https://developers.google.com/appengine/docs/python/config/appconfig#Required_Elements
If you start from Python 2.5 please read:
https:// developers.google.com/appengine/docs/python/python25/migrate27#appyaml
I am trying to deploy mercurial for google app engine and keep getting this error. Please see if anyone has a solution.
<type 'exceptions.ImportError'>: No module named pwd
Traceback (most recent call last):
File "/base/data/home/apps/ajatus-graphics/2.339364808142331297/hgapp.py", line 33, in <module>
main()
File "/base/data/home/apps/ajatus-graphics/2.339364808142331297/hgapp.py", line 23, in main
from dashboard import dashboard
File "/base/data/home/apps/ajatus-graphics/2.339364808142331297/dashboard.py", line 3, in <module>
from mercurial import templater, templatefilters, util
File "/base/python_dist/lib/python2.5/py_zipimport.py", line 242, in load_module
exec code in mod.__dict__
File "/base/data/home/apps/ajatus-graphics/2.339364808142331297/hg.zip/mercurial/templater.py", line 10, in <module>
File "/base/python_dist/lib/python2.5/py_zipimport.py", line 242, in load_module
exec code in mod.__dict__
File "/base/data/home/apps/ajatus-graphics/2.339364808142331297/hg.zip/mercurial/util.py", line 543, in <module>
File "/base/python_dist/lib/python2.5/py_zipimport.py", line 242, in load_module
exec code in mod.__dict__
File "/base/data/home/apps/ajatus-graphics/2.339364808142331297/hg.zip/mercurial/posix.py", line 10, in <module>
maybe one of these projects will be of use?
http://bitbucket.org/durin42/mercurial-appengine/overview
http://appgallery.appspot.com/about_app?app_id=agphcHBnYWxsZXJ5chQLEgxBcHBsaWNhdGlvbnMYne8BDA (see also https://www.mercurial-scm.org/pipermail/mercurial/2008-December/022692.html )
You can't access the unix password database in the App Engine sandbox, so the pwd module isn't installed.
In general, many random python modules will require extensive hacking to get them to run on App Engine.
The simplest way is remove import pwd. Because when you run on GAE, you don't need this module.