Can't Use Pycrypto in Google App Engine Production - python

I am successfully using Pycrypto vs. 2.6 in my GAE development environment under Python 2.7. However, deploying it to Google production I see the following error in the logs:
from Crypto.Cipher import _AES ImportError: cannot import name _AES
My App.Yaml:
application: appname
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
secure: always
libraries:
- name: webapp2
version: "2.5.2"
- name: pycrypto
version: "2.6"
The Python call in question:
from Crypto.Cipher import AES
Checking Google support documents and they do list Pycrypto 2.6 as supported. I also tried to enter "latest" for the version and received the same error. Again in development GAE on my local machine it works perfectly.

Issue resolved. I had a directory from my Windows installation called "Crypto" in my App Engine project directory. When the app loader loaded the files it also included this directory which conflicted with what Google has loaded in production. Removal of this directory from the local project directory resolved the problem upon the next push to Google.

Related

Unable to set manual scaling on a google app engine service

I am unable to set manual scaling on a google app engine service (Previously called module). Using python on app engine.
app.yaml:
application: xxx-xxxx
version: 2
runtime: python27
module: xxbackend
instance_class: F4
api_version: 1
threadsafe: true
handlers:
- url: /taskcontroller\.py
script: TaskController.app
so on...
libraries:
- name: webapp2
version: latest
- name: numpy
version: "1.6.1"
- name: PIL
version: latest
inbound_services:
- warmup
xxbackend.yaml:
application: xxx-xxxx
version: uno
module: xxbackend
runtime: python27
api_version: 1
instance_class: B4
manual_scaling:
instances: 5
Even though I have specified instance class and manual scaling settings in xxbackend.yaml, the xxbackend instances are still autoscaled. Can someone point out where I am going wrong?
You have the same module: name is both yamls. app.yaml should not specify a module, so it uses the default module. So remove module: xxbackend from app.yaml. Otherwise, you are overriding the expected config.
Then, when you deploy, use a command like:
appcfg.py update app.yaml xxbackend.yaml
That deploys both updated yaml files.

Google App Engine Error at yaml_error

Following error as shown in screen-shot,occurs when i try to run my helloworld.py script in Google App engine from terminal.
#My Operating system:Ubuntu.14.#
And Here is my file app.yaml.
application: #My project Id.
version: 1
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /static
static_dir: static
- url: /
static_files: static/index.html
upload: static/index\.html
secure: always
- url: /_ah/spi/.*
script: helloworld_api.app
libraries:
- name: endpoints
version: 1.0
The Problem is that i can't deploy my code on local machine.
Any helps would be Appreciated.Thanks :)
I had check Online Yaml parser and it shows its Valid too.
You're missing the libraries line, the endpoints library are actually interpreted as part of the handlers list, which is incorrect.
Should look like this:
...
- url: /_ah/spi/.*
script: helloworld_api.app
libraries:
- name: endpoints
version: 1.0

MissingURLMapping: No URLMap entries found in application configuration

I'm new in GAE development, I've just created a simple API but I'm unable to run my app, because I keep getting the error No URLMap entries found in application configuration.
Here's my app.yaml file
application: gw2
version: 1
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /_ah/spi/.*
script: main.api_server
libraries:
- name: pycrypto
version: latest
- name: endpoints
version: 1.0
And here is my main.py file where I've declared the api_server variable
from google.appengine.ext import endpoints
import api
api_server = endpoints.api_server([api.GW2Service])
GW2Service inherits from remote.Service
Edit I'm using command line tools (Ubuntu 12.04)
Where's the mistake?
Thanks in advance. Eric ~H
You start server from the app or command line?
Try using "import endpoints" not from ... import endpoints
In app.yaml set endpoints version to latest.
Move GW2Service to main.py and test if server is ok. The problem might be generated by file name "api".

google-app-engine The library "endpoints" is not supported.

I'm attempting to create endpoints for my google-app-engine in Python. I've followed the directions on https://developers.google.com/appengine/docs/python/endpoints/ and when I attempt to upload I am getting the following message:
Host: appengine.google.com Error parsing yaml file: the library
"endpoints" is not supported in "guestbook/app.yaml", line 22,
column 1
I believe I've got everything configured correctly, can anyone point me in the right direction? I believe having the library import for "endpoints" is critical for this to function.
Here is my app.yaml file:
application: xxxxxxx
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /_ah/spi/.*
script: enders.application
- url: /stylesheets
static_dir: stylesheets
- url: /.*
script: main.app
secure: always
libraries:
- name: endpoints
version: "1.0"
- name: pycrypto
version: "2.6"
- name: webapp2
version: latest
- name: jinja2
version: latest
Make sure you're using the most recent version of the AppEngine SDK. Cloud Endpoints was moved to a library in version 1.8.5.
lucemia pushed me down the right path. I had two versions of the SDK so I removed the older version and voila, problem solved.

Error uploading application Python Google App Engine

I have been trying to upload python Google app engine folder using windows command prompt. I have the app.yaml as well as a python file in the folder. But when I pass the following command in the Command Prompt:
appcfg.py --oauth2 update C:/Path/to/the/folder
I get this error.
appcfg.py: error: Directory does not contain an Project.yaml configuration file.
Where am I wrong and how should I proceed?
This is my app.yaml file:
application: myappid
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: sampleapp.app
libraries:
- name: lxml
version: "latest"
Check your shell syntax. I had this error message also, by not referencing the right project folder. Note the ending slash:
appcfg.py --oauth2 update C:/Path/to/the/folder/

Categories

Resources