albertauyeung / albertauyeung.github.io

Homepage
https://albertauyeung.github.io/
0 stars 1 forks source link

pyenv, virtualenv and using them with Jupyter - Albert Au Yeung #12

Closed albertauyeung closed 9 months ago

albertauyeung commented 4 years ago

https://albertauyeung.github.io/2020/08/17/pyenv-jupyter.html

It is common that the different projects you are working on depend on different versions of Python. That is why pyenv becomes very handy for Python developer...

alcazar90 commented 3 years ago

Hi Albert. Very useful post and great workflow to work with python. A couple of question:

  1. I understand from your post that its not necessary to install in each environment ipython/jupyter using pip. In case of required jupyter its just enough to create a kernel and associated the environment, then using just a "general" jupyter?

  2. Do you recommend install jupyterlab from brew?

  3. Exist a way some way to create automatically the kernel.json file when you created an environment with pyenv virtualenv? I mean something that emulate ipython kernel install --user --name=<name>

best, Cristóbal

albertauyeung commented 3 years ago

@alcazar90 Thanks for your comment! To answer your questions:

  1. Yes, I think it is easier to create kernels instead of installing jupyter in each different virtual environment.
  2. I don't think it is necessary to install jupyterlab from brew, I haven't tried it, and I haven't really encountered any problem using pip to install jupyterlab so far.
  3. I tried but the kernel.json file just wasn't updated automatically, that's why in the post I suggested editing the file manually. If you know of some ways to automate that, please share! Thank you again!
alcazar90 commented 3 years ago

@albertauyeung I installed jupyter globally in one of the python versions using pip, but I have problems running virtualenv as kernels following your instructions at least if I previously installed ipykernel in each of the environment I want to used it.

Im searching a way to automate the kernel creation...any advance with this I comment here! best,