我在远程ubuntu机器上运行anaconda jupyter笔记本,我有三个独立的conda环境。
base * /home/user/anaconda3
dev /home/user/anaconda3/envs/dev
pytorch /home/user/anaconda3/envs/pytorch
为了使用juypter笔记本远程,我使用localhost:8888作为基础环境,我想将 pytorch 环境的默认端口配置为localhost:8889。这样
c.NotebookApp.port = 8889
但是当我尝试
时notebook --generate-config
命令,它询问我是否要覆盖。
Overwrite /home/user/.jupyter/jupyter_notebook_config.py with default config? [y/N]
有没有办法可以为 pytorch conda环境独立于 base conda环境生成jupyter配置文件?
答案 0 :(得分:0)
您可以在配置中添加一些逻辑(未经测试):
public class Type {
public X getWhateverYouWantToAppend() {
// Return stuff for TypeA, TypeB, and any other subtype of Type
}
}
public class TypeC extends Type {
public X getWhateverYouWantToAppend() {
// Return stuff for TypeC specifically
}
}
public class YourOtherClass {
public void append(Type item) {
X thingToAppend = item.getWhateverYouWantToAppend();
// Do the appending
}
}