我是靠谱客的博主 复杂小蝴蝶,这篇文章主要介绍Anaconda3 镜像,插件,虚拟环境,内核,现在分享给大家,希望可以做个参考。

镜像

  • 恢复默认镜像
复制代码
1
2
conda config --remove-key channels

 

插件

  • conda方式安装
复制代码
1
2
3
4
5
6
conda install -c conda-forge jupyter_contrib_nbextensions conda install -c conda-forge jupyter_nbextensions_configurator jupyter contrib nbextension install --user jupyter nbextensions_configurator enable --user
  • pip方式安装
复制代码
1
2
3
4
5
pip install jupyter_nbextensions_configurator jupyter_contrib_nbextensions jupyter contrib nbextension install --user jupyter nbextensions_configurator enable --user
复制代码
1
2
3
4
5
6
7
8
9
pip install qgrid jupyter nbextension enable --py --sys-prefix widgetsnbextension #要想使用 Qgrid 渲染数据帧,开发者只需导入 Qgrid,然后将数据帧输入到 show_grid 函数: import qgrid qgrid_widget = qgrid.show_grid(df, show_toolbar=True) qgrid_widget

数据交互

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pip install ipywidgets jupyter nbextension enable --py widgetsnbextension jupyter labextension install @jupyter-widgets/jupyterlab-manager import ipywidgets as widgets from ipywidgets import interact, interact_manual pip install qgrid #Installing with pip conda install qgrid #Installing with conda pip install itables from itables import init_notebook_mode init_notebook_mode(all_interactive=True)import world_bank_data as wb df = wb.get_countries() df pip install jupyter-datatables from jupyter_datatables import init_datatables_mode init_datatables_mode() pip install ipyvolume #通过pip安装 conda install -c conda-forge ipyvolume #通过conda进行安装 pip install bqplot conda install -c conda-forge bqplot pip install livelossplot from livelossplot import PlotLossesKeras model.fit(X_train, Y_train, epochs=10, validation_data=(X_test, Y_test), callbacks=[PlotLossesKeras()], verbose=0) pip install tensorwatch pip install -U polyaxon pip install handcalcs pip install jupyternotify import numpy as np %timeit np.random.normal(size=1000)

https://zhuanlan.zhihu.com/p/360446521
https://zhuanlan.zhihu.com/p/350421120
https://www.tiobe.com/tiobe-index/
https://www.w3cschool.cn/assembly/assembly-plastic.html
https://www.runoob.com/php/php-intro.html
https://www.runoob.com/js/js-howto.html
https://www.runoob.com/csharp/csharp-tutorial.html
https://www.runoob.com/postgresql/postgresql-create-table.html

 

虚拟环境

  • 查看安装了哪些包
复制代码
1
2
conda list
  • 查看当前存在哪些虚拟环境
复制代码
1
2
3
conda env list conda info -e
  • 检查更新当前conda
复制代码
1
2
conda update conda
  • Python创建虚拟环境
复制代码
1
2
conda create -n your_env_name python=x.x
  • 激活或者切换虚拟环境

Linux:

复制代码
1
2
source activate your_env_nam

Windows:

复制代码
1
2
activate your_env_name
  • 关闭虚拟环境

Linux:

复制代码
1
2
source deactivate your_env_nam

Windows:

复制代码
1
2
deactivate your_env_name
  • 删除虚拟环境
复制代码
1
2
conda remove -n your_env_name --all

 

虚拟环境改名字

复制代码
1
2
3
4
5
6
7
8
# 新建一个新的环境,克隆原环境 conda create --name NewName --clone OldName # 删除原环境 conda remove --name OldName --all # 激活新环境 conda activate NewName

 

内核

  • 查看内核版本
复制代码
1
2
python -m ipykernel --version
  • 查看当前存在哪些内核
复制代码
1
2
jupyter kernelspec list
  • 安装内核
复制代码
1
2
python -m pip install ipykernel
  • 添加内核
复制代码
1
2
python -m ipykernel install --user --name=your_kernelname --display-name your_showname
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## pip 安装 pip install jupyter ## 安装jupyterlab pip install jupyterlab ## 安装依赖关系(npm, nodejs) pip install npm conda install -c conda-forge nodejs 生成配置文件 默认保存:~/.jupyter/jupyter_notebook_config.py jupyter notebook --generate-config 或 jupyter lab --generate-config 2. 配置密码 现在最近版本的jupyter可以直接用以下命令: $ jupyter notebook password 配置一下 jupyter_notebook_config.py 文件 c.NotebookApp.ip = '*' c.NotebookApp.allow_root = True c.NotebookApp.port = 8888 ## 启动notebook jupyter notebook --no-browser --port=8889 ## 启动lab jupyter lab --no-browser --port=8889 Jupyter notebook 更换kernel 由于jupyter notebook访问的时候,默认使用了anaconda的base环境,这里就需要更换环境 安装ipykernel conda install nb_conda_kernels 将环境写入notebook的kernel中 python -m ipykernel install --user --name 环境名称 --display-name "显示的名称" 查看安装的内核和位置 jupyter kernelspec list 删除 kernel jupyter kernelspec remove tensorflow 然后 需要在你需要切换的虚拟环境下安装 内核,命令如下 我是在 TensorFlow2的环境下安装的 conda install ipykernel
复制代码
1
2
3
4
5
6
7
8
9
10
软件包"anaconda clean"(可从Anaconda平台获得),需要安全卸载。 复制代码 conda install anaconda-clean # install the package anaconda clean anaconda-clean --yes # clean all anaconda related files and directories rm -rf ~/anaconda3 # removes the entire anaconda directory rm -rf ~/.anaconda_backup # anaconda clean creates a back_up of files/dirs, remove it # (conda list; cmd shouldn't respond after the clean up)

https://zhuanlan.zhihu.com/p/161221247

https://blog.csdn.net/weixin_42416683/article/details/112300633

https://zhuanlan.zhihu.com/p/166425946

最后

以上就是复杂小蝴蝶最近收集整理的关于Anaconda3 镜像,插件,虚拟环境,内核的全部内容,更多相关Anaconda3内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部