我需要在每个虚拟环境中安装Jupyter笔记本吗? [英] Do I need to install Jupyter notebook in every virtual environment?

查看:1011
本文介绍了我需要在每个虚拟环境中安装Jupyter笔记本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用pipenv将数据科学项目隔离到虚拟环境中.但是,运行Jupyter notebok不会访问本地环境,而是使用默认的IPyKernel.我已经看到,您可以在环境中注册虚拟环境,但这需要安装本身需要Jupyter的ipykernel软件包!

I isolate my data science projects into virtual environments using pipenv. However, running a Jupyter notebok does not access the local environment and uses the default IPyKernel. I've seen that you can register virtual environments from within the environment, but this requires installing the ipykernel package which itself requires Jupyter!

有没有避免这种情况的方法,而仅对所有虚拟环境使用一个Jupyter安装?

Is there anyway to avoid this and just use a single Jupyter install for all virtual environments?

推荐答案

通常,您将安装一次jupyter并在虚拟环境中执行以下操作:

Generally, you'd install jupyter once and do the following in your virtual environments:

pip install ipykernel  
python -m ipykernel install --user

当您运行多个Python版本时,这还不够.
这里有一个指南试图解决这个问题:
https://medium.com/@ henriquebastos/the-definitive-guide-to-setup-my-python-workspace-628d68552e14

This isn't enough when you're running multiple Python versions.
There's a guide here that tries to address this:
https://medium.com/@henriquebastos/the-definitive-guide-to-setup-my-python-workspace-628d68552e14

它不是100%故障安全的,但可以帮助您避免一直重新安装jupyter笔记本电脑.

It's not 100% failsafe, but it can help you avoid reinstalling jupyter notebook all the time.

这篇关于我需要在每个虚拟环境中安装Jupyter笔记本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆