Backup on raspberry Pi

I use Deepstack on a Raspberry Pi with the Intel Movidius Neural Compute Stick 2. That works fine, but now that I’ve learned it quiet some faces I would like backup the data. There is an example of how to do that but since I’m a complete Nono with both the Raspberry and Python I can’t get it to work. It gives errors like this:

>>> import requests
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'
>>> from io import  open
>>> import shutil
>>>
>>> data = requests.post("http://192.168.0.125:80/v1/backup",stream=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'requests' is not defined
>>>
>>> with open("backupdeepstack.zip", "wb") as file:
...     shutil.copyfileobj(data.raw, file)
... del data

There’s probably someone out there how knows what I do wrong and how I should run this job. And explain that to me in plain English.

By the way. This is the code given by Deepstack to backup.

import requests
from io import  open
import shutil

data = requests.post("http://localhost:80/v1/backup",stream=True)

with open("backupdeepstack.zip", "wb") as file:
    shutil.copyfileobj(data.raw, file)
del data
1 Like

Nobody out there with an answer?

I think I solved it myself by adding:

sudo pip3 install requests

and then rerun under Python3.

No errors now. I only have to find the backup-file and save it on a secure place.

1 Like