2012-02-23 68 views
0

這裏的(複製粘貼)回溯:拋出RPy_Exception,R功能 「」 找不到

Traceback Switch to copy-and-paste view 

/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py in get_response 
        response = middleware_method(request) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/middleware/common.py in process_request 
      if (not _is_valid_path(request.path_info, urlconf) and ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/middleware/common.py in _is_valid_path 
     urlresolvers.resolve(path, urlconf) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py in resolve 
    return get_resolver(urlconf).resolve(path) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py in resolve 
        sub_match = pattern.resolve(new_path) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py in resolve 
        sub_match = pattern.resolve(new_path) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py in resolve 
      return ResolverMatch(self.callback, args, kwargs, self.name) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py in _get_callback 
      self._callback = get_callable(self._callback_str) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/utils/functional.py in wrapper 
     result = func(*args) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py in get_callable 
       lookup_view = getattr(import_module(mod_name), func_name) ... 
▶ Local vars 
/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py in import_module 
    __import__(name) ... 
▶ Local vars 
/home/harsh/minip-server/website/Video_Performance/views.py in <module> 
import datetime,rpy ... 
▶ Local vars 
/usr/lib/python2.6/dist-packages/rpy.py in <module> 
r = R() ... 
▶ Local vars 
/usr/lib/python2.6/dist-packages/rpy.py in __init__ 
     self.get = _rpy.get_fun('get') # this must happen before any calls to self or its methods! ... 
▶ Local vars 

任何線索?

編輯: 下面的代碼

import rpy 

不要誤會我的意思,它的誤差在即將行。我嘗試了一個單獨的Python提示符,並且import rpy不會失敗。只有在網站上它失敗了。爲什麼?

+0

號碼代碼在哪裏? – Marcin 2012-02-23 09:40:57

+0

@Marcin:現在看 – prongs 2012-02-23 09:46:24

+0

最好我可以建議你的配置有問題。請注意,堆棧跟蹤會進入您要導入的庫中。那裏可能有什麼錯誤的線索。 – Marcin 2012-02-23 09:48:04

回答

0

這可能是一個多線程問題。對R的併發訪問是不好的(在「不跨越流,這將是壞的」意義上)。 rpy2有一個鎖定機制,當它即將發生時應該引發異常。

+1

這也與所選進程缺少必需的堆棧內存有關。在我的情況下,我必須在產生應用程序進程之前運行這個命令:'ulimit -s unlimited'。但我會建議不要把它當作無限制的生產。 – 2014-02-20 16:54:19