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中的Cursor使用详解

《Java中的Cursor使用详解》本文介绍了Java中的Cursor接口及其在大数据集处理中的优势,包括逐行读取、分页处理、流控制、动态改变查询、并发控制和减少网络流量等,感兴趣的朋友一起看看吧... 最近看代码,有一段代码涉及到Cursor,感觉写法挺有意思的。注意是Cursor,而不是Consumer

Node.js net模块的使用示例

《Node.jsnet模块的使用示例》本文主要介绍了Node.jsnet模块的使用示例,net模块支持TCP通信,处理TCP连接和数据传输,具有一定的参考价值,感兴趣的可以了解一下... 目录简介引入 net 模块核心概念TCP (传输控制协议)Socket服务器TCP 服务器创建基本服务器服务器配置选项服

如何使用CSS3实现波浪式图片墙

《如何使用CSS3实现波浪式图片墙》:本文主要介绍了如何使用CSS3的transform属性和动画技巧实现波浪式图片墙,通过设置图片的垂直偏移量,并使用动画使其周期性地改变位置,可以创建出动态且具有波浪效果的图片墙,同时,还强调了响应式设计的重要性,以确保图片墙在不同设备上都能良好显示,详细内容请阅读本文,希望能对你有所帮助...

Rust中的注释使用解读

《Rust中的注释使用解读》本文介绍了Rust中的行注释、块注释和文档注释的使用方法,通过示例展示了如何在实际代码中应用这些注释,以提高代码的可读性和可维护性... 目录Rust 中的注释使用指南1. 行注释示例:行注释2. 块注释示例:块注释3. 文档注释示例:文档注释4. 综合示例总结Rust 中的注释

Linux使用cut进行文本提取的操作方法

《Linux使用cut进行文本提取的操作方法》Linux中的cut命令是一个命令行实用程序,用于从文件或标准输入中提取文本行的部分,本文给大家介绍了Linux使用cut进行文本提取的操作方法,文中有详... 目录简介基础语法常用选项范围选择示例用法-f:字段选择-d:分隔符-c:字符选择-b:字节选择--c

使用Go语言开发一个命令行文件管理工具

《使用Go语言开发一个命令行文件管理工具》这篇文章主要为大家详细介绍了如何使用Go语言开发一款命令行文件管理工具,支持批量重命名,删除,创建,移动文件,需要的小伙伴可以了解下... 目录一、工具功能一览二、核心代码解析1. 主程序结构2. 批量重命名3. 批量删除4. 创建文件/目录5. 批量移动三、如何安

springboot的调度服务与异步服务使用详解

《springboot的调度服务与异步服务使用详解》本文主要介绍了Java的ScheduledExecutorService接口和SpringBoot中如何使用调度线程池,包括核心参数、创建方式、自定... 目录1.调度服务1.1.JDK之ScheduledExecutorService1.2.spring

Java使用Tesseract-OCR实战教程

《Java使用Tesseract-OCR实战教程》本文介绍了如何在Java中使用Tesseract-OCR进行文本提取,包括Tesseract-OCR的安装、中文训练库的配置、依赖库的引入以及具体的代... 目录Java使用Tesseract-OCRTesseract-OCR安装配置中文训练库引入依赖代码实

Java中对象的创建和销毁过程详析

《Java中对象的创建和销毁过程详析》:本文主要介绍Java中对象的创建和销毁过程,对象的创建过程包括类加载检查、内存分配、初始化零值内存、设置对象头和执行init方法,对象的销毁过程由垃圾回收机... 目录前言对象的创建过程1. 类加载检查2China编程. 分配内存3. 初始化零值4. 设置对象头5. 执行

Python使用Pandas对比两列数据取最大值的五种方法

《Python使用Pandas对比两列数据取最大值的五种方法》本文主要介绍使用Pandas对比两列数据取最大值的五种方法,包括使用max方法、apply方法结合lambda函数、函数、clip方法、w... 目录引言一、使用max方法二、使用apply方法结合lambda函数三、使用np.maximum函数