[Toaster] virtualenv for toaster and python 3

Ed Bartosh ed.bartosh at linux.intel.com
Wed Jun 1 13:12:35 PDT 2016


On Wed, Jun 01, 2016 at 10:24:52AM -0700, Christopher Larson wrote:
> On Wed, Jun 1, 2016 at 2:27 AM, Ed Bartosh <ed.bartosh at linux.intel.com>
> wrote:
> 
> > On Tue, May 31, 2016 at 11:48:01AM -0700, Christopher Larson wrote:
> > > On Tue, May 31, 2016 at 11:47 AM, Brian Avery <avery.brian at gmail.com>
> > wrote:
> > >
> > > > One possible solution is to use RP's suggestion to leverage the --user
> > > > argument (which stores packges in
> > > > $HOME/.local/lib/python3.4/site-packages.
> > > >
> > > > >pip3 install --user -r poky/bitbake/toaster-requirements.txt
> > > > * works except wsgiref is not python3 compatible yet
> > > > >pip3 list installed --local
> > > > argparse (1.2.1)
> > > > beautifulsoup4 (4.4.1)
> > > > Django (1.8.13)
> > > >
> > > > * works to show what is a --user install vs a global site install.
> > > > > pip3 uninstall/install --user --upgrade/.... works as expected...
> > > >
> > >
> > > Cluttering up my ~/.local with app/project specific requirements is not
> > > appropriate. As someone who uses --user quite a bit, I'd be quite annoyed
> > > by this.
> >
> > So far pip3 --user looks like the only working approach to me. It's not
> > ideal, but it's not that bad either. It should be used for its direct
> > purpose
> > - to install dependencies for 'one user' mode.
> >
> > For production Toaster instances I'd suggest to install runtime
> > dependencies on the host system.
> >
> > BTW, Toaster has only one runtime requirement: Django. argparse and
> > wsgiref is a legacy and beautifulsoup4 is not a runtime dependency. It's
> > used only
> > in tests.
> 
> 
> --user is intended for use by the user,  not your scripts.
True. I'm not saying that toaster should do that. User will run pip3
install --user 'Django>1.8<1.9' or install Django 1.8 any other suitable
way.

> I choose what I put there for good reason. Your use case is what virtual environments are
> for. If toaster can't handle that, it should be fixed to do so.
Toaster can't be fixed to setup an environment where python is python2
and python3 is python3. Neither virtualenv or venv support this.

> From the python documentation:
> 
> This scheme is designed to be the most convenient solution for users that
> don’t have write permission to the global site-packages directory or don’t
> want to install into it.
Yes, and this is exactly what I'm proposing. Sorry for not being clear.

--
Regards,
Ed


More information about the toaster mailing list