importing app engine sample in eclipse - google-app-engine

Downloaded GAE sample code and copied into Eclipse pydev explorer
and got following errors on execution
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 67, in <module>
run_file(__file__, globals())
File "C:\Program Files\Google\google_appengine\dev_appserver.py", line 63, in run_file
execfile(script_path, globals_)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 417, in <module>
sys.exit(main(sys.argv))
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_main.py", line 360, in main
config, matcher = dev_appserver.LoadAppConfig(root_path, {})
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3441, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError

This error occurs commonly if you don't have app.yaml or dev_appserver didn't find it. Can you ensure that you ran dev_appserver . with the project directory being the working directory? Also, please include app.yaml in your question, if the file actually exists.

Related

Google App Engine Deploy AttributeError expat_CAPI

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.

Fatal devappserver2 error: PYTHON_EGG_CACHE in Appengine 1.7.6 and 1.7.5 python 2.7, win7

I attempted to use Appengine SDK version 1.7.6 but was receiving fatal errors (same as outlined below) so reverted to 1.7.5, where my app works fine. However, the errors I saw in 1.7.6 recur when I attempt to run the experimental devappserver in 1.7.5. I am running Python 2.7 on a win 7 machine. Standard install selections for AppEngine.
These error messages refer to permissions relating to the PYTHON_EGG_CACHE, but...
- 1) They do not occur for the 'old' dev_appserver
- 2) The application can successfully extract files to the location noted. In fact, I changed the path of the PYTHON_EGG_CACHE to another location, gave it wide open permissions, and still received the error.
- 3) I have pyyaml in my site-packages, so am not sure why it would need to do a temporary extract anyway.
Any help looking for a resolution to this would be appreciated, since I'll be forced to use the new devappserver in a couple of releases time.
Command line error dump below:
python "C:\Program Files (x
86)\Google\google_appengine\devappserver2.py" .
WARNING 2013-03-25 19:10:41,029 devappserver2.py:497] devappserver2.py is curre
ntly experimental but will eventually replace dev_appserver.py in the App Engine
Python SDK. For more information and to report bugs, please see: http://code.go
ogle.com/p/appengine-devappserver2-experiment/
INFO 2013-03-25 19:10:41,171 appcfg.py:618] Checking for updates to the SDK.
WARNING 2013-03-25 19:10:44,525 simple_search_stub.py:975] Could not read searc
h indexes from c:\users\ben\appdata\local\temp\appengine.dev~upskillme-main.Ben\
search_indexes
INFO 2013-03-25 19:10:44,539 api_server.py:148] Starting API server at: http
://localhost:49302
INFO 2013-03-25 19:10:44,555 dispatcher.py:96] Starting server "default" run
ning at: http://localhost:8080
INFO 2013-03-25 19:10:44,571 admin_server.py:112] Starting admin server at:
http://localhost:8000
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line
150, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line
146, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de
vappserver2\python\runtime.py", line 39, in <module>
from google.appengine.ext.remote_api import remote_api_stub
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remo
te_api\remote_api_stub.py", line 75, in <module>
import yaml
File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\__init
__.py", line 14, in <module>
from cyaml import *
File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\cyaml.
py", line 5, in <module>
from _yaml import CParser, CEmitter
File "C:\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", lin
e 7, in <module>
File "C:\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", lin
e 4, in __bootstrap__
File "C:\Python27\lib\site-packages\pkg_resources.py", line 882, in resource_f
ilename
self, resource_name
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1351, in get_resou
rce_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1406, in _extract_
resource
manager.extraction_error() # report a user-friendly error
File "C:\Python27\lib\site-packages\pkg_resources.py", line 928, in extraction
_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache
The following error occurred while trying to extract file(s) to the Python egg
cache:
[Error 5] Access is denied: 'C:\\Users\\Ben\\AppData\\Roaming\\Python-Eggs\\py
yaml-3.10-py2.7-win32.egg-tmp\\_yaml.pyd'
The Python egg cache directory is currently set to:
C:\Users\Ben\AppData\Roaming\Python-Eggs
Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.
Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 551, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\de
vappserver2\server.py", line 1045, in _loop_adjusting_instances
self._adjust_instances()
If anyone comes along with the same issue, the resolution that worked for me was as follows:
Unzip the PyYAML-3.10-py2.7-win32.egg in your python27 site-packages
directory into a new directory within site-packages. You'll need to
unzip it to into a directory name like NEWPyYAML-3.10-py2.7-win32.egg
to avoid name conflicts.
Rename your original egg. to something else (e.g., OLDPyYAML-3.10-py2.7-win32.egg).
Rename your new directory to PyYAML-3.10-py2.7-win32.egg
All references to the egg will now actually point to a directory in your site-packages containing the unzipped python files. The new devappserver should be able to work with this.
Unsure how to unzip an egg in windows? See here (presuming you have Winzip or similar installed):
http://mail.python.org/pipermail/chicago/2007-July/002301.html

cannot run helloworld in Google app engine launcher

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

Running the basic Google App

I am trying to run the basic google app in my localhost. But I seem to have some error which i am not able to solve:
Error when i typed: dev_appserver.py /Users/GoogleApp/helloworld
Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 133, in <module>
run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 129, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py", line 694, in <module>
sys.exit(main(sys.argv))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py", line 582, in main
root_path, {}, default_partition=default_partition)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3217, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError
Not able to solve it..
Yo need to have an app.yaml file in you application directory (in your case /Users/GoogleApp/helloworld). See the docs for details. Refer to the Getting Started Guide (section Creating the Configuration File) for more examples.
Keep the helloworld subdirectory outside the sdk directory, eg:
/home/helloworld

AppConfigNotFoundError for dev_appserver.py on Django-nonrel and Google App Engine

I'm trying to clear my local db like explained in the docs
But when I try and run the dev_appserver.py --clear_datastore command I get google.appengine.tools.dev_appserver.AppConfigNotFoundError
dev_appserver.py --clear_datastore dennys
Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 76, in <module>
run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 72, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py", line 687, in <module>
sys.exit(main(sys.argv))
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py", line 575, in main
appinfo, matcher = dev_appserver.LoadAppConfig(root_path, {})
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 4359, in LoadAppConfig
raise AppConfigNotFoundError
google.appengine.tools.dev_appserver.AppConfigNotFoundError
You have to specify the directory of your application in the command line to dev_appserver.py.
I solved this problem by going to:
Run --> Debug Configurations --> (right click) PyDev Google App Run --> New
Type the project name under "Project".
Then click on "Arguments" and put the path location of where your app.yaml file is. The picture below describes what I'm talking about:
You are missing the boolean yes value as stated in the docs:
dev_appserver.py --clear_datastore=yes myapp

Resources