Issue #187 resolved

Permission issue with sudo -u 'user' /bin/bash -l -c 'mkvirtualenv venv'

Sebastien Beal
created an issue

I am trying to create a virtualenv using fabric and virtualenvwrapper. I create a user with the appropriate bash shell and environment variables and then I create a virtualenv using the following fabric command:

sudo('mkvirtualenv venv', user='user')

Which is equivalent to:

sudo -u "user"  /bin/bash -l -c "mkvirtualenv venv"

I receive a permission denied when the command try to copy python to /venv/bin/python. However when I log in as the 'user' and use mkvirtualenv venv everything is working fine. Any idea where this could be coming from?

Comments (5)

  1. Sebastien Beal reporter

    It works when I provide the full path to the targeted directory. mkvirtualenv also works with the appropriate full path instead of just the name of the project.

  2. Doug Hellmann repo owner

    It looks like WORKON_HOME is not being set properly by the combination of shell options and startup files you're using. I would experiment with moving the settings between ~/.bash_profile and ~/.bashrc (I can never remember which is used for a login shell and which is used for "regular" shells, but the manpage for bash should say).

  3. Log in to comment