snipsco / snips-issues

Feel free to share your bugs with us.
14 stars 5 forks source link

pip fails to install requirements because it tries to use the `.cache` owned by login user instead of the one owned by _snips-skills #186

Open psiniemi opened 5 years ago

psiniemi commented 5 years ago

What's the issue?

Pip is run with simply sudo -u _snips-skill and the -H argument that would set the correct home is omitted and thus pip tries to use the login user's (pi) pip cache.

Use Cases Impacted

sam install assistant

How to reproduce

sam install assistant

Expected behavior

Requirements should be installed into the venv

Version and Environment

0.63.3 / Lubuntu 19.04

Logs

Running setup.sh & generating virtual environment for mossrock-snips 
✖ Error setting up virtualenv, one or more actions might not be able to run. Reason :
WARNING: The directory '/home/pi/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/home/pi/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Additional information

Workaround

Add -H flag to /usr/local/lib/node_modules/snips-sam/lib/session/ssh.js where it runs the setup.sh