我将自动备份模块从github存储库(https://github.com/Yenthe666/auto_backup)克隆到我的Odoo机器中,并将正确的依赖项添加到odoo-server.conf文件中,但是当我点击"更新模块列表"在应用程序上,我得到以下消息:
Traceback (most recent call last):
File "/opt/odoo/openerp/http.py", line 544, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/openerp/http.py", line 581, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/openerp/http.py", line 317, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/openerp/http.py", line 314, in checked_call
return self.endpoint(*a, **kw)
File "/opt/odoo/openerp/http.py", line 810, in __call__
return self.method(*args, **kw)
File "/opt/odoo/openerp/http.py", line 410, in response_wrap
response = f(*args, **kw)
File "/opt/odoo/addons/web/controllers/main.py", line 948, in call_button
action = self._call_kw(model, method, args, {})
File "/opt/odoo/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 439, in old_api
result = new_api(recs, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 443, in new_api
result = [method(rec, *args, **kwargs) for rec in self
File "/opt/odoo/openerp/addons/base/module/wizard/base_module_update.py", line 15, in update_module self.updated, self.added = self.env['ir.module.module'].update_list()
File "/opt/odoo/openerp/api.py", line 266, in wrapper
return new_api(self, *args, **kwargs)
File "/opt/odoo/openerp/api.py", line 508, in new_api
result = method(self._model, cr, uid, *args, **old_kwargs)
File "/opt/odoo/openerp/addons/base/module/module.py", line 651, in update_list
handler.load_addons()
File "/opt/odoo/openerp/http.py", line 1317, in load_addons
m = __import__('openerp.addons.' + module)
File "/opt/odoo/openerp/modules/module.py", line 80, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/opt/odoo/auto_backup/auto_backup/__init__.py", line 23, in
import backup_scheduler
File "/opt/odoo/auto_backup/auto_backup/backup_scheduler.py", line 33, in
raise ImportError('This module needs pysftp to automaticly write backups to the FTP through SFTP.
Please install pysftp on your system. (sudo pip install pysftp)')
ImportError: This module needs pysftp to automaticly write backups to the FTP through SFTP. Please install pysftp on your system. (sudo pip install pysftp)
然后我在终端输入了sudo pip install pysftp
,我得到了
Requirement already satisfied (use --upgrade to upgrade): pysftp in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): paramiko>=1.17 in /usr/local/lib/python2.7/dist-packages (from pysftp)
Cleaning up...
我甚至尝试输入sudo pip install pysftp --upgrade
,但我得到了
Requirement already up-to-date: pysftp in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: paramiko>=1.17 in /usr/local/lib/python2.7/dist-packages (from pysftp)
Cleaning up...
你能帮帮我吗?
答案 0 :(得分:0)
我找到了解决方案!如果有人有类似的问题,我所做的是:
我尝试输入sudo pip uninstall pysftp
,它没有用,然后我做了:
sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev
这是运行pysftp所需的依赖项(感谢@lukebranch在github存储库问题上找到了它)。此时,如果卸载pysftp工作,重新安装pysftp并重新启动Odoo服务器应该可以正常工作。但就我而言,还不够。
之后,我输入python
进入python环境然后import pysftp
。我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pysftp/__init__.py", line 12, in <module>
import paramiko
File "/usr/local/lib/python2.7/dist-packages/paramiko/__init__.py", line 30, in <module>
from paramiko.transport import SecurityOptions, Transport
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 33, in <module>
from cryptography.hazmat.backends import default_backend
ImportError: No module named cryptography.hazmat.backends
所以我退出了python环境,然后输入了sudo pip install paramiko
和sudo pip install cryptography
。最后我再次进入python环境并键入import pysftp
,它运行良好。
希望它可以帮助别人!