[IPython-dev] Installing kernels and libs under a virtual env

Matthias Bussonnier bussonniermatthias at gmail.com
Tue Dec 30 16:42:46 EST 2014


From what I can tell it is perfectly normal to install a vent kernel to be use globally, and we try not to have any venv specific code for the Jupyter part. 
Installing was the most problematic part in last discussion, and there is no "right" answer so the only logical one is to try to do as least as possible.

-- 
M

Envoyé de mon iPhone

> Le 30 déc. 2014 à 22:31, Doug Blank <doug.blank at gmail.com> a écrit :
> 
>> On Tue, Dec 30, 2014 at 3:51 PM, Doug Blank <doug.blank at gmail.com> wrote:
>>> On Tue, Dec 30, 2014 at 2:28 PM, Fernando Perez <fperez.net at gmail.com> wrote:
>>> Hi Doug,
>>> 
>>>> On Tue, Dec 30, 2014 at 9:57 AM, Doug Blank <doug.blank at gmail.com> wrote:
>>>> I think that if "python setup.py install --user" under a venv went to the virtual env's local, then everything would be fine. But maybe I'm doing something wrong (need to use pip?).
>>> 
>>> 
>>> The issue is that the list of targets is hardcoded here:
>>> 
>>> https://github.com/ipython/ipython/blob/master/IPython/kernel/kernelspec.py#L21
>>> 
>>> that code isn't currently aware in any way of virtualenvs.
>>> 
>>> I'm fuzzy on the details of how we ended up deciding we'd interact with venvs, other than saying that we'll try to bake as little knowledge of 'environment managers' (venv, conda, etc) directly into our kernel installation tools directly.  That discussion has lots of subtly interacting moving parts, and I'm afraid to say something misleading right now.
>>> 
>>> Min and Thomas were deep in those details, and I'd wait for further feedback from them (or anyone else who remembers well).  But in the meantime, you may want to play with that code in a local copy: you may find a minimally intrusive improvement for venv support that could be a good solution for a PR.
>> 
>> Actually, the kernel is installed fine, and is found in the user's kernel area. It is the installed Python code with "--user" that causes the issue. Maybe this is just a venv/setup interaction bug.
> 
> I see that distutils can use either a --user flag or a --prefix flag, but not both at the same time. Adding a "prefix" kwarg option could also work for install_kernel_spec, and would solve the problem that I am currently running into with venv with --user.
> 
> Min and/or Thomas: does that sound like a viable option?
> 
> -Doug
> 
>> 
>> -Doug
>>  
>>> 
>>> Cheers,
>>> 
>>> f
>>> 
>>> 
>>> 
>>> -- 
>>> Fernando Perez (@fperez_org; http://fperez.org)
>>> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
>>> fernando.perez-at-berkeley: contact me here for any direct mail
>>> 
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141230/8396bda2/attachment.html>


More information about the IPython-dev mailing list