google-app-engine


ImportError: No module named _ctypes running Python Flask tutorial for Google App Engine on Windows


I'm just trying to run the simple hello world app on their tutorials page. I used to use Google App Engine frequently, but now I can't seem to get it going at all. I'm on win 10 x64. Downloaded latest google cloud sdk, and python version 2.7.13
> ERROR 2017-01-07 15:25:21,219 wsgi.py:263] Traceback (most recent
> call last): File "C:\Program Files (x86)\Google\Cloud
> SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py",
> line 240, in Handle
> handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) File "C:\Program Files (x86)\Google\Cloud
> SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py",
> line 299, in _LoadHandler
> handler, path, err = LoadObject(self._handler) File "C:\Program Files (x86)\Google\Cloud
> SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py",
> line 85, in LoadObject
> obj = __import__(path[0]) File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\main.py",
> line 18, in <module>
> from flask import Flask File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\flask\__init__.py",
> line 21, in <module>
> from .app import Flask, Request, Response File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\flask\app.py",
> line 27, in <module>
> from . import json, cli File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\flask\cli.py",
> line 17, in <module>
> import click File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\click\__init__.py",
> line 18, in <module> INFO 2017-01-07 10:25:21,229 module.py:806]
> default: "GET / HTTP/1.1" 500 -
> from .core import Context, BaseCommand, Command, MultiCommand, Group, \ File
> "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\click\core.py", line 8, in <module>
> from .types import convert_type, IntRange, BOOL File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\click\types.py",
> line 4, in <module>
> from ._compat import open_stream, text_type, filename_to_ui, \ File
> "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\click\_compat.py",
> line 536, in <module>
> from ._winconsole import _get_windows_console_stream File "C:\....\python-docs-samples\appengine\standard\flask\hello_world\lib\click\_winconsole.py",
> line 16, in <module>
> import ctypes File "C:\Python27\lib\ctypes\__init__.py", line 7, in <module>
> from _ctypes import Union, Structure, Array File "C:\Program Files (x86)\Google\Cloud
> SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\devappserver2\python\sandbox.py",
> line 964, in load_module
> raise ImportError('No module named %s' % fullname)
ImportError: No module named _ctypes
Google's sample Flask "Hello World" application requires Flask 0.11.1.
This library is not vendored by Google, so developers are required to install it via pip
This sample shows how to use Flask with Google App Engine Standard.
Before running or deploying this application, install the dependencies
using pip:
pip install -t lib -r requirements.txt
Flask's setup.py instructs pip to install the click library, at a release later than or equal to version 2.0.
install_requires=[
'Werkzeug>=0.7',
'Jinja2>=2.4',
'itsdangerous>=0.21',
'click>=2.0',
],
In November 2015 a change was committed to click to improve support for unicode in the windows console. This change added the import of the ctypes library which Appengine is choking on, because the Appengine sandbox does not allow importing ctypes.
The workaround for this is to overwrite the installed click with an earlier version (5.1 looks like the most recent candidate):
pip install --target lib --upgrade click==5.1

Related Links

Blackberry Push SDK on Google App Engine
App engine 1.4.0 urlfetch() data over 1M
Google App Engine + Validation
GQL Random Record [duplicate]
AppEngine entity modeling - minimizing entity groups and achieving atomic cascading update/delete
What does _ah mean in Google App Engine?
Spring Roo with GAE error on most basic tests
Running a web crawler for selected sites on google app engine?
Many-to-many relationship modeling in google app engine
Appengine: ClassCastException in query with string of leng
How to integrate user quotas?
Restlet that works on localhost throws NullPointerException when deployed on GAE
No module named Crypto.Cipher on local mac AppEngine
Should I use a GZIP compression middleware or not?
AppEngine vs. sendmail space problem
nosetests 'cannot import name mkdir'

Categories

HOME
facebook-oauth
ng-idle
c99
ecmascript-6
android-studio-2.2
pascal
simulink
ado.net
pearson-correlation
settings
google-admin-sdk
okhttp
openstreetmap
minecraft-forge
github-enterprise
java.util.logging
cmdb
rtf
libc
flatpak
coin3d
android-7.0-nougat
shortest-path
google-maps-autocomplete
pagespeed
inno-download-plugin
monit
slidetoggle
outliers
firebase-analytics
genexus-sd
inversion-of-control
rselenium
android-sugarorm
contacts
google-knowledge-graph
android-augmented-reality
metaprogramming
chef-solo
apache-stanbol
datacachefactory
proget
openrasta
serde
dotnet-httpclient
globalize
qtranslate
java-bytecode-asm
django-1.10
shinobi
gets
mediametadataretriever
cda
kendo-upload
cycle2
concept-insights
vhosts
character-replacement
video-player
rpart
baasbox
skspritenode
exceldatareader
infosphere-spl
execve
android-cookiemanager
mruby
pseudo-class
spy++
mobility
parallel-testing
hibernate-entitymanager
windows-phone-8-sdk
nebula
extreme-programming
frameworkelementfactory
jdb
isa-swizzling
wiimote
cross-database
pylucene
timertask
uideviceorientation
vs-android
binomial-heap
ajax-polling
complex-event-processing
sifr3
business-model
wcf-proxy

Resources

Encrypt Message