简体   繁体   中英

Google App Engine appcfg.py raising Value Error

I am following the app-engine mobile backend tutorial on the following website: https://cloud.google.com/resources/articles/how-to-build-mobile-app-with-app-engine-backend-tutorial

I am developing on a Windows 8 machine and using Java 7 64-bit

I have installed app-engine-sdk-1.8.6 as an eclipse plugin and set the GAE_SDK_ROOT environment variable to: E:\\android-sdk\\adt-bundle-windows-x86_64-20130917\\eclipse\\plugins\\com.google.appengine.eclipse.sdkbundle_1.8.6\\appengine-java-sdk-1.8.6

What I found surprising was there were no python files in the above installation directory.I had to manually download appcfg.py.

The tutorial uses an upload_data.sh file to Upload data to datastore.As I am developing on Windows I am using an equivalent batch file upload_data.bat whose contents are as follows:

python appcfg.py upload_data --config_file bulkloader.yaml --url="http://localhost:8888/remote_api" --filename $1 --kind=$2 -e nobody@nowhere.com

When I run the batch file I get the following error:

E:\\AppEngineExample\\UploadScript>upload_data.bat places.csv Place

E:\AppEngineExample\UploadScript>python appcfg.py upload_data --config_file bulkloader.yaml
 --url="http://localhost:8888/remote_api" --filename $1 --kind=$2 -e nobody@nowhere.com
Traceback (most recent call last):
  File "appcfg.py", line 90, in <module>
    DIR_PATH = get_dir_path(os.path.join('lib', 'ipaddr'))
  File "appcfg.py", line 70, in get_dir_path
    'directory' % gae_sdk_root)
ValueError: GAE_SDK_ROOT 'E:\\android-sdk\\adt-bundle-windows-x86_64-20130917\\eclipse\\plugins\\com.google.appengine.eclipse.sdkbundle_1.8.6\\appengine-java-sdk-1.8.6' does not refer to a valid SDK directory

Please Help!!

I'm following the same tutorial in a similar environment (Windows 8.1, Java 7 64 bit).

After a lot of struggling on the exact same issue *no upload_data argument available in the appcfg.cmd script in the bundled app engine SDK*, I decided to install Python 2.7 and the stand-alone app engine SDK (download it here: https://developers.google.com/appengine/downloads ).

In this stand-alone install there is the appcfg.py file (located in the root of the install folder, I've added this to the path). After this I created the following windows bat file to get the upload running successfully:

@echo off
appcfg.py upload_data --config_file bulkloader.yaml --url=http://localhost:8888/remote_api --filename=%1 --kind=%2 --email=nobody@nowhere.com

Run this script in the MobileAssistant-Data directory using this command:

upload_data.bat places.csv Place

I'm now continuing the tutorial, let's see what more obstacles are ahead ;)

GAE has multiple SDK/runtimes, amongst them python and java. appcfg.py it the tool for the python runtime.

The eclipse plugin SDK downloads the java SDK/runtime. You use appcfg.cmd instead of appcfg.py

Running appcfg.py against the Java SDK will not work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM