- download anaconda and install it to a specific directory
- in PyCharm, go to preference->project intepreter->add local->Conda Environment, choose the installed anaconda as interpreter.
- Sometimes we can install a smaller environment. In command line, type "conda create --name your_env_name python=3.5".
- Use command "conda activate your_env_name" to activate the environment, use command "conda deactivate" to deactivate it.
- then we can install package diretly use command, such as "conda install tensorflow"
- Go to pycharm, go to preference->project intepreter->add local->Conda Environment, choose the installed anaconda new env as interpreter. Directory is "~/anaconda3/envs/xxx/bin/python"
- Since we already created the environment, so in PyCharm, we chooose existing environment, and go to find the python executable file under directory "~/anaconda3/envs/xxx/bin/python".
- Go to your developed env: conda activate your_env_name
- conda install ipykernel
- ipython kernel install --user --name=<any_name_for_kernel>, after this, system will create a new kernel directory under "/Users/m102853/Library/Jupyter/kernels/<any_name_for_kernel>"
- jupyter notebook
- Then in notebook, select your customized kernel, you can test your sys path by using "sys.executable"
Reference:https://stackoverflow.com/questions/37433363/link-conda-environment-with-jupyter-notebook