auto_backup: pysftp dependency is not being recognized
I’ve cloned the github repository into my Odoo machine and added the correct dependency on odoo-server.conf file, but when I click “Update modules list” on the application, I got the following message:
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 <module> import backup_scheduler File “/opt/odoo/auto_backup/auto_backup/backup_scheduler.py”, line 33, in <module> 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)
Then I typed sudo pip install pysftp in the terminal and I got
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…
I even tryed to type sudo pip install pysftp --upgrade but I got
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…
Could you help me on that, please?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 30 (9 by maintainers)
FWIW on another instance i’ve run into the following issue while attempting this again from another web hosting company:
Traceback (most recent call last): File “/usr/bin/pip”, line 5, in <module> from pkg_resources import load_entry_point File “/usr/local/lib/python2.7/dist-packages/pkg_resources/init.py”, line 70, in <module> import packaging.version ImportError: No module named packaging.version
I have resolved it using the following method (as root user): apt-get purge -y python-pip wget https://bootstrap.pypa.io/get-pip.py python ./get-pip.py apt-get install python-pip
thanks to the suggestions on this blog: https://odedrabhavesh.blogspot.hk/2017/02/importerror-no-module-named.html
@wangdaze ,
I haven’t encountered your specific issue personally, however I believe it is still due to missing dependencies on your system. Try removing pysftp first and then do this:
sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev
then reinstall pysftp and see if you still encounter the same issues. I’m pretty sure that specific error is related to the build-essentials dependency.
You don’t have to understand, but Google is your friend 😉
@Yenthe666 I was able to install pysftp on my older servers (for 8.0 and 9.0) because they were initially on Ubuntu 14.04. It is only on my newly created 16.04 instances running Odoo 10.0. I’ll give your master version a try, thanks!
Hi all,
I’ve decided to drop the
pysftplibrary in the upcoming V11 and change it directly toparamenko. This means there’ll be less dependencies downloaded and installed (sincepysftpitself depends on a lot of other stuff too). I’m slowly changing the behaviour (locally, not yet on Github) and only face a major problem on theparaminkotransfer methods in case there is no folder. The goal is to have this new dependency in place before V11.@lukebranch yes it would be possible to hook into other libraries and execute methods (for example through a shell or virtual environment). I do believe that this is a bit tricky / extreme to accomplish this though as it’ll most likely have more chance of breaking than just a python library as it works now. Hope you agree / understand 😉
Regards, Yenthe
@beatrizlana-br Thanks for your sharing!It works,first I install cryptography ,It not work until reboot .Thanks for all
Thanks for all the answers guys! I rebooted the server and nothing happened, but I found out the solution. I’ll put it here in case someone has the same issues:
I typed
pythonin the terminal, thenimport pysftpand I got the messageThen I exited python and typed
sudo pip install cryptography. After that I entered python again and typedimport pysftpand it worked.Hi @beatrizlana-br,
Looks like your Ubuntu has issues with figuring out what is installed or not installed. The easiest fix is a full reboot of your server, then the system should know the exact state.
@lukebranch Thanks!
@beatrizlana-br ,
I am in no way involved with this project, however as another user I did find that I needed to: sudo pip uninstall pysftp
to remove the library first. then: sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev
to install some required tools and libraries related to installing pysftp.
and then: sudo pip install pysftp
to reinstall pysftp. Once you’ve done this restart the odoo service, or your server and see if you still run into this issue again.
In my case pysftp was not being compiled properly on a clean Ubuntu 14.04 instance, and these were the steps I needed to follow to get it working.