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

相关文章

使用Python实现可恢复式多线程下载器

《使用Python实现可恢复式多线程下载器》在数字时代,大文件下载已成为日常操作,本文将手把手教你用Python打造专业级下载器,实现断点续传,多线程加速,速度限制等功能,感兴趣的小伙伴可以了解下... 目录一、智能续传:从崩溃边缘抢救进度二、多线程加速:榨干网络带宽三、速度控制:做网络的好邻居四、终端交互

Python中注释使用方法举例详解

《Python中注释使用方法举例详解》在Python编程语言中注释是必不可少的一部分,它有助于提高代码的可读性和维护性,:本文主要介绍Python中注释使用方法的相关资料,需要的朋友可以参考下... 目录一、前言二、什么是注释?示例:三、单行注释语法:以 China编程# 开头,后面的内容为注释内容示例:示例:四

Go语言数据库编程GORM 的基本使用详解

《Go语言数据库编程GORM的基本使用详解》GORM是Go语言流行的ORM框架,封装database/sql,支持自动迁移、关联、事务等,提供CRUD、条件查询、钩子函数、日志等功能,简化数据库操作... 目录一、安装与初始化1. 安装 GORM 及数据库驱动2. 建立数据库连接二、定义模型结构体三、自动迁

ModelMapper基本使用和常见场景示例详解

《ModelMapper基本使用和常见场景示例详解》ModelMapper是Java对象映射库,支持自动映射、自定义规则、集合转换及高级配置(如匹配策略、转换器),可集成SpringBoot,减少样板... 目录1. 添加依赖2. 基本用法示例:简单对象映射3. 自定义映射规则4. 集合映射5. 高级配置匹

Spring 框架之Springfox使用详解

《Spring框架之Springfox使用详解》Springfox是Spring框架的API文档工具,集成Swagger规范,自动生成文档并支持多语言/版本,模块化设计便于扩展,但存在版本兼容性、性... 目录核心功能工作原理模块化设计使用示例注意事项优缺点优点缺点总结适用场景建议总结Springfox 是

SQLite3 在嵌入式C环境中存储音频/视频文件的最优方案

《SQLite3在嵌入式C环境中存储音频/视频文件的最优方案》本文探讨了SQLite3在嵌入式C环境中存储音视频文件的优化方案,推荐采用文件路径存储结合元数据管理,兼顾效率与资源限制,小文件可使用B... 目录SQLite3 在嵌入式C环境中存储音频/视频文件的专业方案一、存储策略选择1. 直接存储 vs

嵌入式数据库SQLite 3配置使用讲解

《嵌入式数据库SQLite3配置使用讲解》本文强调嵌入式项目中SQLite3数据库的重要性,因其零配置、轻量级、跨平台及事务处理特性,可保障数据溯源与责任明确,详细讲解安装配置、基础语法及SQLit... 目录0、惨痛教训1、SQLite3环境配置(1)、下载安装SQLite库(2)、解压下载的文件(3)、

使用Python绘制3D堆叠条形图全解析

《使用Python绘制3D堆叠条形图全解析》在数据可视化的工具箱里,3D图表总能带来眼前一亮的效果,本文就来和大家聊聊如何使用Python实现绘制3D堆叠条形图,感兴趣的小伙伴可以了解下... 目录为什么选择 3D 堆叠条形图代码实现:从数据到 3D 世界的搭建核心代码逐行解析细节优化应用场景:3D 堆叠图

Springboot如何正确使用AOP问题

《Springboot如何正确使用AOP问题》:本文主要介绍Springboot如何正确使用AOP问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录​一、AOP概念二、切点表达式​execution表达式案例三、AOP通知四、springboot中使用AOP导出

Navicat数据表的数据添加,删除及使用sql完成数据的添加过程

《Navicat数据表的数据添加,删除及使用sql完成数据的添加过程》:本文主要介绍Navicat数据表的数据添加,删除及使用sql完成数据的添加过程,具有很好的参考价值,希望对大家有所帮助,如有... 目录Navicat数据表数据添加,删除及使用sql完成数据添加选中操作的表则出现如下界面,查看左下角从左