当前位置:网站首页>pycharm在虚拟环境下跑jupyter notebook问题记录
pycharm在虚拟环境下跑jupyter notebook问题记录
2022-07-27 05:23:00 【sin_404】
下面都是屁话,只需要安装一个包就够了
pip install ipykernel pycharm提示你是否把本项目注册进kernel
-----------------------------------分割线---------------------------------
一 、最近在pycharm里运行ipynb文件发现个问题,如果是在自带虚拟环境的venv里会提示:jupyter kernel does not match project interpreter
提示内核版本不匹配,要求register project interpreter as kernel,选择的话提示dll问题找不到模块
事实上此时jupyter是已经启动了的,且可以在网页上访问,猜测是pycharm识别的问题
我通过重复安装tornado包 【只是随便尝试卸载再重新安装解决了这个问题,缺失包后再安装pycharm会重新引导启动流程】
pip install 'tornado==6.1' --force-reinstall
# 或者
pip uninstall tornado
&&
pip install tornado
二、如果是在conda的虚拟环境里要用jupyter notebook的话,发现pycharm显示 jupyer notebook中只有系统的python3环境
1.安装 ipykernel
pip install ipykernel 2. 将环境写入notebook的kernel中,
python -m ipykernel install --user --name your_env_name --display-name your_env_name
举例:我的环境名称为 jupy
python -m ipykernel install --user --name jupy --display-name 'Python(jupy)'看效果:kernel切换了

三、最后提一句,如果要在base conda的notebook里切换环境,需要 pip install nb_conda,就可以在打开的jupyter文件里看到change kernel项了
另外删除kernel环境:
jupyter kernelspec remove 环境名称
查看kernel列表
jupyter kernelspec list
边栏推荐
- Programming learning records - Lesson 4 [branch and loop statements]
- Compatibility test knowledge points
- Addition, deletion, modification and query of the database at the terminal
- where接自定义函数导致查询缓慢
- Basic file operation of cmder
- Bug classification and defect and CSV file testing
- shell函数
- Linu performance tuning: how can we alleviate the situation in the face of DDoS attacks?
- PXE efficient batch network installation
- Iptables firewall, SNAT and DNAT
猜你喜欢
随机推荐
Basic knowledge of English: juxtaposition structure
FTP服务简介与配置
gradle的安装配置及使用
PXE高效批量网络装机
源码编译安装LAMP和DISCUZ论坛
兼容性测试知识点
C language - Custom structure type
反射器中getattr,hasattr,delattr,setattr的使用
Shell script delete automatically clean up files that exceed the size
接口测试概念及Postman工具简介使用
英语基础知识: 并列结构
Multi coordinate transformation
Shell Scripting format
shell函数
If conditional statement of shell
Database commands
Joint query of database
Decorator functions and the use of class decorators
Source code compilation and installation lamp and discuz Forum
Programming learning records - Lesson 7 [functions]









