Page 1 of 1

[SOLVED] Restore packages

Published: September 5, 2018 - 1:57 PM
by Mathieu
Good morning,

I just reinstalled my server because I was on a nightly version, once the installation was done I wanted to do the restoration as in the procedure via the command /usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/wapt/ except that I get an error message.

Code: Select all

/usr/bin/python /opt/wapt/wapt-scanpackages.py /var/www/wapt/
Traceback (most recent call last):
  File "/opt/wapt/wapt-scanpackages.py", line 32, in <module>
    from waptutils import __version__,setloglevel
  File "/opt/wapt/waptutils.py", line 41, in <module>
    import requests
ImportError: No module named requests
How to continue the procedure

Thank you

Re: Restoring packages

Published: September 5, 2018 - 3:34 PM
by htouvet
simply do

Code: Select all

wapt-scanpackages /var/www/wapt
Normally the wapt-scanpackages script is in /usr/lbin, so in the path

The error stems from the fact that wapt now has its own 'virtualenv' for the server as well.
The Python libraries (requests, for example) are located in /opt/wapt, and this location must be declared before running the wapt-scanpackages.py Python script. This is what /usr/bin/wapt-scanpackages does

Code: Select all

#!/bin/bash
sudo -u wapt PYTHONHOME=/opt/wapt PYTHONPATH=/opt/wapt /opt/wapt/bin/python /opt/wapt/wapt-scanpackages.py $@

Re: Restoring packages

Published: September 5, 2018 - 3:45 PM
by Mathieu
Thank you

, we'll need to look into modifying your procedure:
https://www.wapt.fr/fr/doc/waptserver_b ... stauration