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

相关文章

使用Sentinel自定义返回和实现区分来源方式

《使用Sentinel自定义返回和实现区分来源方式》:本文主要介绍使用Sentinel自定义返回和实现区分来源方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Sentinel自定义返回和实现区分来源1. 自定义错误返回2. 实现区分来源总结Sentinel自定

Pandas使用SQLite3实战

《Pandas使用SQLite3实战》本文主要介绍了Pandas使用SQLite3实战,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学... 目录1 环境准备2 从 SQLite3VlfrWQzgt 读取数据到 DataFrame基础用法:读

JSON Web Token在登陆中的使用过程

《JSONWebToken在登陆中的使用过程》:本文主要介绍JSONWebToken在登陆中的使用过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录JWT 介绍微服务架构中的 JWT 使用结合微服务网关的 JWT 验证1. 用户登录,生成 JWT2. 自定义过滤

Java中StopWatch的使用示例详解

《Java中StopWatch的使用示例详解》stopWatch是org.springframework.util包下的一个工具类,使用它可直观的输出代码执行耗时,以及执行时间百分比,这篇文章主要介绍... 目录stopWatch 是org.springframework.util 包下的一个工具类,使用它

Java使用Curator进行ZooKeeper操作的详细教程

《Java使用Curator进行ZooKeeper操作的详细教程》ApacheCurator是一个基于ZooKeeper的Java客户端库,它极大地简化了使用ZooKeeper的开发工作,在分布式系统... 目录1、简述2、核心功能2.1 CuratorFramework2.2 Recipes3、示例实践3

springboot security使用jwt认证方式

《springbootsecurity使用jwt认证方式》:本文主要介绍springbootsecurity使用jwt认证方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录前言代码示例依赖定义mapper定义用户信息的实体beansecurity相关的类提供登录接口测试提供一

go中空接口的具体使用

《go中空接口的具体使用》空接口是一种特殊的接口类型,它不包含任何方法,本文主要介绍了go中空接口的具体使用,具有一定的参考价值,感兴趣的可以了解一下... 目录接口-空接口1. 什么是空接口?2. 如何使用空接口?第一,第二,第三,3. 空接口几个要注意的坑坑1:坑2:坑3:接口-空接口1. 什么是空接

springboot security快速使用示例详解

《springbootsecurity快速使用示例详解》:本文主要介绍springbootsecurity快速使用示例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝... 目录创www.chinasem.cn建spring boot项目生成脚手架配置依赖接口示例代码项目结构启用s

Python如何使用__slots__实现节省内存和性能优化

《Python如何使用__slots__实现节省内存和性能优化》你有想过,一个小小的__slots__能让你的Python类内存消耗直接减半吗,没错,今天咱们要聊的就是这个让人眼前一亮的技巧,感兴趣的... 目录背景:内存吃得满满的类__slots__:你的内存管理小助手举个大概的例子:看看效果如何?1.

java中使用POI生成Excel并导出过程

《java中使用POI生成Excel并导出过程》:本文主要介绍java中使用POI生成Excel并导出过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录需求说明及实现方式需求完成通用代码版本1版本2结果展示type参数为atype参数为b总结注:本文章中代码均为