Search code examples
python-2.7nao-robotpepperchoregraphe

Cascade dependencies when add python packages to my app libraries


I'm trying to add python packages to my Choregraphe app because some packages that are installed by default with python 2.7 aren't in python embedded in Choregraphe.

I want to add urllib3 and certifi to my app to be able to sen HTTPS requests and verify SSL certificates.

So I added a lib folder to my app with the necessary packages, it works fine for urllib3 but to verify SSL certificates I got a cascade of dependencies so I don't manage to do what I want.

Does anyone know if there is a way to access manually the default python version accessible by my Robot so that I can send my request with these packages ?

Thanks in advance !


Solution

  • If you're running this on a Pepper with NAOqi 2.5, pip is installed on the robot; though you'll need to upgrade it:

    pip install --user --upgrade pip
    

    and then you can run

    /home/nao/.local/bin/pip install --user urllib3 certifi
    

    Then you don't need to package those files in your choregraphe package.

    It won't work on the virtual robot (but then you can just add the real path of those libraries to sys.path), and it means you'll have to do this procedure yourself if you want to install your app on a new robot, which can be a hassle.