Using virtualenv to bypass sudoer issues

Asaf Las roegltd at gmail.com
Fri Feb 7 22:03:51 EST 2014


On Saturday, February 8, 2014 3:18:02 AM UTC+2, Cameron Simpson wrote:
> On 06Feb2014 18:32, Jean-Michel Pichavant <je... at sequans.com> wrote:
> 
> > Assuming I have a debian workstation for which I don't have any
> > sudo rights, in order to be able to install / remove python packages,
> > should I be using virtualenv ? Is it a suited solution ?
> 
> It is well suited.
> 
> You can also do far simpler (and far smaller setups) like this:
> 
>   mkdir -p $HOME/lib/python
> 
> and in your environment (eg $HOME/.profile or $HOME/.bash_profile) add:
> 
>   PYTHONPATH=$HOME/lib/python:$PYTHON_PATH
>   export PYTHONPATH
> and simply install (copy) packages into that directory.
> 
> This is conceptually the same as having a $HOME/bin with commands
> or your own in it, etc.
> 
> If you're getting your packages from pypi, virutalenv may be easier
> to use in the long run.  besides, it lets you make multiple
> environments for different flavours of Python (2 vs 3, etc).
> 
> Cheers,
> 
> Cameron Simpson <cs at zip.com.au>
> 
> I just kept it wide-open thinking it would correct itself.
> Then I ran out of talent.       - C. Fittipaldi

Hi 

Does this approach work with mixed packages comprising non python
code? 

/Asaf



More information about the Python-list mailing list