This is probably a really simple problem but the hardest part of coding for me is always getting my computer set up. I have a repo set up on my computer with some .ipynb
files for an online class I’m taking. I wanted to try to do best practices of setting up venvs for each of my projects though, and I am having trouble getting my venv and Jupyter to mesh.
I created a venv in my repo from the command line, installed jupyter and pandas into the venv (and I see them when I do a pip freeze
and which python3
points to the right place, etc. so it seems all there). I also created(?) a kernel which the internet said to do,ipython kernel install --user --name=venv
The problem is that now when I launch jupyter lab, I can create new notebook files that are correctly pointing to the venv kernel and when I do something like import pandas as pd
, it knows what pandas is. But on existing files, I can’t seem to switch the kernel over. I have tried repeatedly in jupyter by clicking in the top right and selecting a different kernel from the dropdown to my venv but it never takes. So it just always keeps saying it can’t find the pandas module because I don’t have it installed globally.
What am I doing wrong here?
Thank you all!
submitted by /u/joliesky
[link] [comments]
r/learnpython This is probably a really simple problem but the hardest part of coding for me is always getting my computer set up. I have a repo set up on my computer with some .ipynb files for an online class I’m taking. I wanted to try to do best practices of setting up venvs for each of my projects though, and I am having trouble getting my venv and Jupyter to mesh. I created a venv in my repo from the command line, installed jupyter and pandas into the venv (and I see them when I do a pip freeze and which python3 points to the right place, etc. so it seems all there). I also created(?) a kernel which the internet said to do,ipython kernel install –user –name=venv The problem is that now when I launch jupyter lab, I can create new notebook files that are correctly pointing to the venv kernel and when I do something like import pandas as pd, it knows what pandas is. But on existing files, I can’t seem to switch the kernel over. I have tried repeatedly in jupyter by clicking in the top right and selecting a different kernel from the dropdown to my venv but it never takes. So it just always keeps saying it can’t find the pandas module because I don’t have it installed globally. What am I doing wrong here? Thank you all! submitted by /u/joliesky [link] [comments]
This is probably a really simple problem but the hardest part of coding for me is always getting my computer set up. I have a repo set up on my computer with some .ipynb
files for an online class I’m taking. I wanted to try to do best practices of setting up venvs for each of my projects though, and I am having trouble getting my venv and Jupyter to mesh.
I created a venv in my repo from the command line, installed jupyter and pandas into the venv (and I see them when I do a pip freeze
and which python3
points to the right place, etc. so it seems all there). I also created(?) a kernel which the internet said to do,ipython kernel install --user --name=venv
The problem is that now when I launch jupyter lab, I can create new notebook files that are correctly pointing to the venv kernel and when I do something like import pandas as pd
, it knows what pandas is. But on existing files, I can’t seem to switch the kernel over. I have tried repeatedly in jupyter by clicking in the top right and selecting a different kernel from the dropdown to my venv but it never takes. So it just always keeps saying it can’t find the pandas module because I don’t have it installed globally.
What am I doing wrong here?
Thank you all!
submitted by /u/joliesky
[link] [comments]