Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start jupyter in an environment created by conda?

I use conda created an environment called testEnv and activated it, after that I use the command jupyter notebook to call the jupyter editor. It works, but the problem is that, I can only create file in the root environment. How can I create file in testEnv environment?

Here are the steps what I have done:

$ conda create -n testEnv python=3.5 # create environmet
$ source activate testEnv # activate the environmet

(testEnv)$ jupyter notebook # start the jupyter notebook

Here are the result, which shows I can only create file with in "root" but not in "testEnv" (There is only Root, but no testEnv):

enter image description here

In the Tab Conda, I can see the testEnv, but how can I switch to it?

enter image description here

like image 947
xirururu Avatar asked Feb 07 '23 08:02

xirururu


1 Answers

You have two options. You can install the Jupyter Notebook into each environment, and run the Notebook from that environment:

conda create -n testEnv python=3.5 notebook
source activate testEnv
jupyter notebook

or you need to install the IPython kernel from testEnv into the environment from which you want to run Jupyter Notebook. Instructions are here: http://ipython.readthedocs.io/en/stable/install/kernel_install.html#kernels-for-different-environments To summarize:

conda create -n testEnv python=3.5
source activate testEnv
python -m ipykernel install --user --name testEnv --display-name "Python (testEnv)"
source deactivate
jupyter notebook
like image 183
darthbith Avatar answered Feb 13 '23 06:02

darthbith