2013-01-17 61 views
0

好的,我放棄了。當我在Google應用引擎上運行我的web2py應用時,我無法修復錯誤消息。我有下一個輸出:文件無法訪問,無法在Google應用引擎上導入庫

WARNING 2013-01-17 01:59:14,379 py_zipimport.py:139] Can't open zipfile 
/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg: 
IOError: [Errno 13] file not accessible: '/usr/local/lib/python2.7/dist- 
packages/setuptools-0.6c11-py2.7.egg' 

WARNING 2013-01-17 01:59:14,380 py_zipimport.py:139] Can't open zipfile 
/usr/local/lib/python2.7/dist-packages/utils-0.1-py2.7.egg: IOError: [Errno 
13] file not accessible: '/usr/local/lib/python2.7/dist-packages/utils- 
0.1-py2.7.egg' 

ERROR 2013-01-17 01:59:14,490 dev_appserver_import_hook.py:1251] Third 
party package Crypto must be included in the "libraries:" clause of your 
app.yaml file in order to be imported. 

WARNING 2013-01-17 01:59:14,727 dev_appserver_import_hook.py:557] Blocking 
access to skipped file "/home/michael/webdev/web2py/gluon/rocket.py" 

我厭倦了將Crypto庫添加到app.yaml,但GAE不支持它。 另外,我不明白爲什麼「文件無法訪問」。 任何想法正在發生什麼?

編輯 我的app.yaml文件是:

application: wormsapp 
version: 1 
api_version: 1 

# use this line for Python 2.5 
# 
#runtime: python 

# use these lines for Python 2.7 
# upload app with: appcfg.py update web2py (where 'web2py' is web2py's root  directory) 
# 
runtime: python27 
threadsafe: true # true for WSGI & concurrent requests (Python 2.7 only) 

default_expiration: "24h" # for static files 

handlers: 

- url: /(?P<a>.+?)/static/(?P<b>.+) 
    static_files: applications/\1/static/\2 
    upload: applications/(.+?)/static/(.+) 
    secure: optional 


#- url: /favicon.ico 
# static_files: applications/welcome/static/favicon.ico 
# upload: applications/welcome/static/favicon.ico 

- url: /favicon.ico 
    static_files: applications/crowdrandk/static/favicon.ico 
    upload: applications/crowdrank/static/favicon.ico 

- url: /robots.txt 
    static_files: applications/welcome/static/robots.txt 
    upload: applications/welcome/static/robots.txt 

- url: .* 
# script: gaehandler.py   # CGI 
    script: gaehandler.wsgiapp # WSGI (Python 2.7 only) 
    secure: optional 

admin_console: 
    pages: 
    - name: Appstats 
    url: /_ah/stats 

skip_files: | 
^(.*/)?(
(app\.yaml)| 
(app\.yml)| 
(index\.yaml)| 
(index\.yml)| 
(#.*#)| 
(.*~)| 
(.*\.py[co])| 
(.*/RCS/.*)| 
(\..*)| 
(applications/(admin|examples)/.*)| 
((admin|examples|welcome)\.(w2p|tar))| 
(applications/.*?/(cron|databases|errors|cache|sessions)/.*)| 
((logs|scripts)/.*)| 
(anyserver\.py)| 
(web2py\.py)| 
((cgi|fcgi|modpython|wsgi)handler\.py)| 
(epydoc\.(conf|css))| 
(httpserver\.log)| 
(logging\.example\.conf)| 
(route[rs]\.example\.py)| 
(setup_(app|exe)\.py)| 
(splashlogo\.gif)| 
(parameters_\d+\.py)| 
(options_std.py)| 
(gluon/tests/.*)| 
(gluon/(rocket|winservice)\.py)| 
(contrib/(gateways|markdown|memcache|pymysql)/.*)| 
(contrib/(populate|taskbar_widget)\.py)| 
(google_appengine/.*)| 
(.*\.(bak|orig))| 
)$ 

builtins: 
- remote_api: on 
- appstats: on 
- admin_redirect: on 
- deferred: on 

libraries: 
- name: numpy 
    version: "latest" 
- name: setuptools 
    version: "latest" 
+0

你的app.yaml是什麼樣的? –

+0

@MartinBlech我將它添加到問題中。 – ashim

+0

你應該將'crypto'添加到庫中。 – doru

回答

3

一下添加到庫:

- name: pycrypto 
    version: "2.6" 

- name: pycrypto 
    version: latest 

它應該工作。

+0

謝謝,它的工作原理。你知道警告的原因是什麼? – ashim

+0

也許[this](http://stackoverflow.com/questions/8799304/ioerror-errno-13-file-not-accessible-with-google-appengine-1-6-1)可以幫助你。 – doru

+0

如果您顯示您的應用程序的文件夾結構,也許我可以幫助您更多。 – doru

相關問題