How to set Julia Environment for IJulia Jupyter notebook?

自作多情 提交于 2021-01-27 06:04:34

问题


I am encountering package compatibility issues within my global Julia environment for specific packages I want to use in a Jupyter notebook. Is there a way to tell IJulia to use a different environment instead of my global one?


回答1:


The default IJulia kernel sets --project=@. so the most convenient way (IMO) is to just keep your project in the same folder as the notebook. The result is that the correct project is used from the start and you don't have to worry about activating it while in the notebook.




回答2:


You can always start up a notebook, and within a cell run

using Pkg
Pkg.activate("./path/to/folder")



回答3:


When starting the notebook type:

notebook(dir="/path/to/your/environment/")

This will launch Jupyter notebook loading the environment (Project.toml) in the directory that you have specified. If there is no Project.toml in that directory, the default (global) environment will be used.




回答4:


Depending on the complexity of your setup, you might want to consider Lmod I use this with a module hierarchy: 1. Core module, 2. Compiler modules, MPI modules. With this, its possible to quickly switch between difference branches.



来源:https://stackoverflow.com/questions/60406075/how-to-set-julia-environment-for-ijulia-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!