首页 > 其他分享 >【2023最新版】PyCharm使用 Jupyter Notebook详解(在conda环境里安装Jupyter~PyCharm使用conda环境~Jupyter自启动)

【2023最新版】PyCharm使用 Jupyter Notebook详解(在conda环境里安装Jupyter~PyCharm使用conda环境~Jupyter自启动)

时间:2023-11-18 16:32:59浏览次数:44  
标签:Jupyter -- conda PyCharm 安装 dir

一、准备工作

1. 安装Anaconda、PyCharm

  win11 安装 Anaconda(2022.10)+pycharm(2022.3/2023.1.4)+配置虚拟环境   Jupyter 是 Anaconda 发行版的一部分,并默认随 Anaconda 一起安装。 (也可以独立安装和使用,无需依赖 Anaconda)

pip install jupyter notebook
conda install jupyter

2. Jupyter官网

  Jupyter官网

3. Jupyter常用命令

Jupyter
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]
 
Jupyter: Interactive Computing
 
positional arguments:
  subcommand     the subcommand to launch
 
optional arguments:
  -h, --help     show this help message and exit
  --version      show the versions of core jupyter packages and exit
  --config-dir   show Jupyter config dir
  --data-dir     show Jupyter data dir
  --runtime-dir  show Jupyter runtime dir
  --paths        show all Jupyter paths. Add --json for machine-readable format.
  --json         output paths as machine-readable json
  --debug        output debug information about paths
 
Available subcommands: bundlerextension console dejavu events execute kernel kernelspec lab labextension labhub
migrate nbclassic nbconvert nbextension notebook qtconsole run script server serverextension troubleshoot trust
 
Please specify a subcommand or one of the optional arguments.

二、PyCharm配置 Jupyter Notebook

  前文介绍了PyCharm配置Anaconda中的Jupyter: ​【2023最新版】PyCharm配置 Jupyter Notebook详解(启动、设置密码、测试等)

三、PyCharm使用Jupyter Notebook

  本文将介绍了PyCharm使用conda虚拟环境中的Jupyter

1. 创建虚拟环境

conda create -n csdn python==3.10

注意,python最新版可能无法使用conda命令安装Jupyter,建议不要安装最新版

创建conda虚拟环境

在这里插入图片描述

Proceed ([y]/n)?

  敲enter直接安装即可即可

conda activate csdn
conda list

在这里插入图片描述

  • 以上过程使用了如下命令,即安装了最新版python
conda create -n csdn python
  • 实践表明,目前python3.12无法使用conda命令安装Jupyter(个人更倾向于使用conda安装,未测试pip命令)

更新conda(请忽略)

注意:如果更新千万千万千万不要中途停止!!!,个人建议不要更新   创建conda虚拟环境时,如果提示:

Collecting package metadata (current_repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 23.7.2
  latest version: 23.9.0

Please update conda by running

    $ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

     conda install conda=23.9.0

  当前使用的Conda版本为23.7.2,而最新版本是23.9.0。建议你通过运行以下命令来更新Conda:

conda update -n base -c defaults conda

  或者,如果你想在更新Conda时减少更新的软件包数量,可以使用以下命令:

conda install conda=23.9.0
中途停止的下场

在这里插入图片描述   conda错乱了……

2. PyCharm使用conda环境

在这里插入图片描述

在这里插入图片描述 在这里插入图片描述   结束上述操作后,环境变为csdn 在这里插入图片描述

3. Jupyter自启动

运行.ipynb文件

在这里插入图片描述

  尚未安装Jupyter~那肯定会运行失败,如图:

在这里插入图片描述

安装Jupyter(PyCharm自动安装)

  上述添加canda环境操作结束后,重启PyCharm,自动检测出Jupyter未安装,点击右侧安装Jupyter即可 在这里插入图片描述   等待安装结束即可: 在这里插入图片描述

报错1. conda错乱

  更新conda中途停止的下场: 在这里插入图片描述

conda activate E:\Software\anaconda3\envs\csdn
E:\Software\anaconda3\condabin\conda.bat install -p E:/Software/anaconda3/envs/csdn jupyter -y

安装Jupyter(命令行)

报错2. python最新版安装失败

  额……python最新版3.12使用conda命令安装时等待n久,此题无解,不要使用最新版python (可以尝试pip安装,这里未进行测试)

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \

conda create -n csdn1 python==3.10
conda activate csdn1
conda install jupyter

在这里插入图片描述

重运行.ipynb文件

在这里插入图片描述 ==successful==

标签:Jupyter,--,conda,PyCharm,安装,dir
From: https://blog.51cto.com/u_16363537/8463478

相关文章

  • 【3.2】Pycharm相关补充
    【一】常用快捷键大全【1】基本编辑快捷键Ctrl+Space:基本的代码完成(类、方法、属性)Ctrl+Alt+Space:快速导入任意类Ctrl+Shift+Enter:语句完成Ctrl+P:参数信息(在方法中调用参数)Ctrl+Q:快速查看文档F1:外部文档Shift+F1:外部文档,进入web文档主页......
  • Conda配置jupyter
    安装nb_condacondainstallnb_conda注册环境python-mipykernelinstall--user--name=testtest是创建的虚拟环境名词,这个命令将在jupyter中注册一个新内核,使得jupyter能够使用你的虚拟环境。启动jupyterjupyternotebook......
  • Conda管理Python版本
    查看Python版本查看当前环境的Python版本condaactivate&&python-V查看指定环境condaactivatetest&&python-V创建Python环境先搜索conda有哪些python版本condasearch--full--namepython根据搜索出来的版本安装condacreate--nametestpython=3.9.7或......
  • Conda常用命令
    查看所有环境列表condainfo--envs*是指当前所处的环境创建新环境condacreate--nametest切换环境condaactivatetest不写名字,会切回base环境删除环境condaremove--nametest--all如果当前在test环境,需要切换其他环境才能删这个环境,不能删当前环境......
  • Pycharm安装之后-简单配置
    简单配置,配置完成后,使用起来一点不简单。第一步,为.py文件添加头部信息路径:File->Setting->Editor->FileandCodeTemplates->PthonScript内容:#!/usr/bin/python3#coding=utf-8#@Time:${DATE}${TIME}#@Author:作者以上内容可以根据自己喜欢,自行调整第二步,常用插件1......
  • linux配置miniconda、pytorch、torch_scatter以及cuda. - 叶辰
    在西方的天际,正在云海中下沉的夕阳仿佛被溶化着,太阳的血在云海和太空中弥漫开来,映现出一大片壮丽的血红。“这是人类的落日。”一,miniconda下载安装以及注意事项1,下载进入官网miniconda正常选择最新版Miniconda3Linux64-bit,jetson选择Miniconda3Linux-aarch6464-bit。......
  • fiddler抓不到pycharm发送的请求解决办法
    在requests发送请求中添加上verify参数response=requests.get(url,verify=False)再次运行会报如下提示:InsecureRequestWarning:UnverifiedHTTPSrequestisbeingmadetohost'127.0.0.1'.Addingcertificateverificationisstronglyadvised.See:https://urllib3......
  • pycharm安装flask库安装失败
    在命令窗口使用以下命令安装flask安装失败1pipinstallflask改用国内镜像源后成功安装1pipinstallflask-ihttp://pypi.douban.com/simple/--trusted-hostpypi.douban.com格式是pipinstall包名-i指定镜像源地址(记得带上/simple/),后面那一串是根据进一步报错信......
  • 刚开始装Acaconda无法创建虚拟环境解决方法
    这个方法完美解决解决anaconda创建环境失败的问题_anaconda创建环境出错-CSDN博客......
  • 软件测试|好用的pycharm插件推荐(四)——Gitee
    简介现在的IDE都是可以集成了代码管理功能的,我们平时可以在pycharm中,轻松实现我们代码的版本管理,但是由于一些原因,GitHub的访问不稳定,我们只能使用国内的代码托管平台Gitee来实现我们的代码管理,但是pycharm是不能直接连接到Gitee仓库的,我们必须要先安装Gitee插件,才能实现pycharm......