JupyterHub学习笔记 普通用户,如何在JupyterHub中创建自己的环境并使用自己的kernel 像screen一样使用jupyterlab 交互运行 jupyternotebook

本文主要是介绍JupyterHub学习笔记 普通用户,如何在JupyterHub中创建自己的环境并使用自己的kernel 像screen一样使用jupyterlab 交互运行 jupyternotebook,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

安装 python2r环境 并激活

conda create -n python2r -y
conda activate python2r

conda install pip -y

conda install mamba -c conda-forge -c bioconda -y

conda install python -y

conda install ipykernel -y

python -m ipykernel install --user --name python2r --display-name "python2r" 

 conda activate squidpyconda install ipykernel -ypython -m ipykernel install --user --name squidpy --display-name "squidpy"  

 

 conda activate cell2loc_envconda install ipykernel -ypython -m ipykernel install --user --namecell2loc_env--display-name "cell2loc_env"  

相关包的安装  How to program with Python and R in Jupyter Notebook - Ander Fernández (anderfernandez.com)Getting started with Python and the IPython notebook — Computational Statistics in Python 0.1 documentation (duke.edu)

conda install -c r r-essentials -y
pip install rpy2[all]
pip install rpy2 -i https://pypi.douban.com/simple/ #rpy2/rpy2: Interface to use R from Python (github.com)

或者使用conda 安装rpy2

 conda install -c "conda-forge/label/cf202003" rpy2 -y

 安装并进入pyscenic环境

conda create -n pyscenic
conda activate pyscenicconda install pipconda install python=3.10
pip install pyscenicconda install ipykernelpython -m ipykernel install --user --name pyscenic --display-name "pyscenic" 




 大概看一下 初步了解

JupyterLab最全详解,如果你还在使用Notebook,那你就out了! - 知乎

快速掌握数据分析必备工具 - ipython和jupyter notebook - 知乎本文帮你快速掌握数据分析师必须会用的两个工具 - ipython和jupyter notebook。 既然有了Python,为什么还要ipython?麦叔不用说话,给你一张图你就明白啦。jupyter notebook又是什么鬼? 建议把本文放到收藏夹。…icon-default.png?t=N7T8https://zhuanlan.zhihu.com/p/356572461

jupyter配置多环境Anconda,轻松切换不同内核 - 知乎   认真看这个,符合自己的需求

在JupyterHub中创建自己的环境可以通过以下步骤完成:

  1. 登录到JupyterHub并进入主页面。

  2. 点击右上角的“New”按钮,然后选择“Terminal”以打开终端。

  3. 在终端中创建一个新的conda环境,例如:

    conda create --name myenv

    这将创建一个名为“myenv”的新环境。

  4. 安装所需的软件包和依赖项,例如:

    conda install numpy pandas matplotlib

    这将在新的conda环境中安装NumPy、Pandas和Matplotlib等包。

  5. 在终端中退出conda环境,例如:

    conda deactivate

6. 返回JupyterHub主页,并点击右上角的“New”按钮,然后选择“Notebook”以打开一个新的Jupyter Notebook。

7. 在Notebook中选择“Kernel” > “Change kernel” > “myenv”来选择刚才创建的新环境作为Kernel。

现在您可以在新的Jupyter Notebook中使用所需的软件包和依赖项,而不会与其他用户或系统环境冲突。

I haved created myenv in conda in my terminal,but i CANNOT find "myenv " as you told me “Kernel” > “Change kernel” > “myenv”. but i can only find python3(ipykernel)

If you have already created your myenv environment using conda in your terminal, but you cannot find it when you try to change the kernel in Jupyter Notebook, you may need to install ipykernel into your myenv environment and register it with Jupyter Notebook. Here are the steps:

  1. Activate your myenv environment in your terminal using the command:

    conda activate myenv

  2. Install ipykernel in your myenv environment using the command:

    conda install ipykernel

  3. Register myenv environment with Jupyter Notebook using the command:

    python -m ipykernel install --user --name myenv --display-name "myenv"

只需要更改  myenv 为自己的环境名称即可

python -m ipykernel install --user --name scvelo --display-name "scvelo"

python -m ipykernel install --user --name pyscenic --display-name "pyscenic" 

  1. This will create a new kernel called myenv in Jupyter Notebook.

  2. Start Jupyter Notebook in your browser and create a new notebook. Then, click on the "Kernel" menu, and you should now see myenv as an option in the "Change kernel" submenu.

    Note: If you don't see myenv in the list of available kernels, try refreshing the page or restarting Jupyter Notebook.

I hope this helps you to use your myenv environment in Jupyter Notebook.

do I need do change the user to my name?

No, you do not need to change the user to your name in order to create and use a new environment in JupyterHub. When you create a new environment using conda in the terminal, it will be associated with your user account by default.

When you start a new Jupyter Notebook, you should be able to see all the available kernels that are installed on your account. The myenv kernel should be listed as an option in the "Kernel" menu. You can select this kernel to use your myenv environment for that particular notebook.

If you still cannot see the myenv kernel, you can try restarting your JupyterHub server and refreshing your browser. If the issue persists, you may need to check that the ipykernel package is installed in your myenv environment and that the kernel has been registered correctly using the python -m ipykernel install command.

使用这环境,如何才能像screen一样,下次可以直接进入,不怕断网

这篇关于JupyterHub学习笔记 普通用户,如何在JupyterHub中创建自己的环境并使用自己的kernel 像screen一样使用jupyterlab 交互运行 jupyternotebook的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/629135

相关文章

使用Java将各种数据写入Excel表格的操作示例

《使用Java将各种数据写入Excel表格的操作示例》在数据处理与管理领域,Excel凭借其强大的功能和广泛的应用,成为了数据存储与展示的重要工具,在Java开发过程中,常常需要将不同类型的数据,本文... 目录前言安装免费Java库1. 写入文本、或数值到 Excel单元格2. 写入数组到 Excel表格

redis中使用lua脚本的原理与基本使用详解

《redis中使用lua脚本的原理与基本使用详解》在Redis中使用Lua脚本可以实现原子性操作、减少网络开销以及提高执行效率,下面小编就来和大家详细介绍一下在redis中使用lua脚本的原理... 目录Redis 执行 Lua 脚本的原理基本使用方法使用EVAL命令执行 Lua 脚本使用EVALSHA命令

Java 中的 @SneakyThrows 注解使用方法(简化异常处理的利与弊)

《Java中的@SneakyThrows注解使用方法(简化异常处理的利与弊)》为了简化异常处理,Lombok提供了一个强大的注解@SneakyThrows,本文将详细介绍@SneakyThro... 目录1. @SneakyThrows 简介 1.1 什么是 Lombok?2. @SneakyThrows

使用Python和Pyecharts创建交互式地图

《使用Python和Pyecharts创建交互式地图》在数据可视化领域,创建交互式地图是一种强大的方式,可以使受众能够以引人入胜且信息丰富的方式探索地理数据,下面我们看看如何使用Python和Pyec... 目录简介Pyecharts 简介创建上海地图代码说明运行结果总结简介在数据可视化领域,创建交互式地

SpringMVC 通过ajax 前后端数据交互的实现方法

《SpringMVC通过ajax前后端数据交互的实现方法》:本文主要介绍SpringMVC通过ajax前后端数据交互的实现方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价... 在前端的开发过程中,经常在html页面通过AJAX进行前后端数据的交互,SpringMVC的controll

Java Stream流使用案例深入详解

《JavaStream流使用案例深入详解》:本文主要介绍JavaStream流使用案例详解,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录前言1. Lambda1.1 语法1.2 没参数只有一条语句或者多条语句1.3 一个参数只有一条语句或者多

Java Spring 中 @PostConstruct 注解使用原理及常见场景

《JavaSpring中@PostConstruct注解使用原理及常见场景》在JavaSpring中,@PostConstruct注解是一个非常实用的功能,它允许开发者在Spring容器完全初... 目录一、@PostConstruct 注解概述二、@PostConstruct 注解的基本使用2.1 基本代

C#使用StackExchange.Redis实现分布式锁的两种方式介绍

《C#使用StackExchange.Redis实现分布式锁的两种方式介绍》分布式锁在集群的架构中发挥着重要的作用,:本文主要介绍C#使用StackExchange.Redis实现分布式锁的... 目录自定义分布式锁获取锁释放锁自动续期StackExchange.Redis分布式锁获取锁释放锁自动续期分布式

springboot使用Scheduling实现动态增删启停定时任务教程

《springboot使用Scheduling实现动态增删启停定时任务教程》:本文主要介绍springboot使用Scheduling实现动态增删启停定时任务教程,具有很好的参考价值,希望对大家有... 目录1、配置定时任务需要的线程池2、创建ScheduledFuture的包装类3、注册定时任务,增加、删

IntelliJ IDEA 中配置 Spring MVC 环境的详细步骤及问题解决

《IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决》:本文主要介绍IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决,本文分步骤结合实例给大... 目录步骤 1:创建 Maven Web 项目步骤 2:添加 Spring MVC 依赖1、保存后执行2、将新的依赖