I try to use a command dev_appserver.py ./from my application directory, but it throws the following error.
ERROR 2016-01-04 04:47:51,421 wsgi.py:263]
Traceback (most recent call last):
File "/Users/Joshua/Scripts/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Users/Joshua/Scripts/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/Users/Joshua/Scripts/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/Users/Joshua/Projects/inkren/skritter-api/main.py", line 2, in <module>
from gcloud import datastore
ImportError: No module named gcloud
I am running virtualenv that has gcloud installed and also gcloud sdk is installed with the corresponding python component. The gcloud library is detected at startup python ./main.py.
import webapp2
from gcloud import datastore
class MainPage(webapp2.RequestHandler):
def get(self):
client = datastore.Client(dataset_id='my-project')
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, World!')
app = webapp2.WSGIApplication([
('/', MainPage),
], debug=True)
What I would like to do is run my code locally in a browser. Is there any way to get dev_appserver.pygcloud library recognition?
source
share