Install Both Python2 and Python3 in Jupyter
2017-06-26 15:53
267 查看
When we install jupyter by Conda, it offers python2 or python3 version. Such as me, I installed conda with python2. But in some cases, the codes are based on python3, so we need both python2 and python3 in one jupyter, and we can choose which version we need simply.
I search google for some results, refers to:
https://stackoverflow.com/questions/30492623/using-both-python-2-x-and-python-3-x-in-ipython-notebook
When the version of Anaconda above 4.1.0, it can easily install two python kernels.
I search google for some results, refers to:
https://stackoverflow.com/questions/30492623/using-both-python-2-x-and-python-3-x-in-ipython-notebook
When the version of Anaconda above 4.1.0, it can easily install two python kernels.
Check Anaconda version
In my server, the version satisfies the requirements.[~]# conda -V conda 4.2.13
Install python kernel
Python2
conda create -n py36 python=2.7 ipykernel
Python3
conda create -n py36 python=3.6 ipykernel
Register kernels
Python 2
conda create -n py27 python=2.7 source activate py27 conda install notebook ipykernel ipython kernel install --user
Python 3
conda create -n py36 python=3.6 source activate py36 conda install notebook ipykernel ipython kernel install --user
Finish
We can see the notebook with both python2 and python3.相关文章推荐
- setup pip, PyMySQL,Jupyter in python 3.3
- Jupyter Notebook教程 in Python
- Python中的可改写类型与不可改写类型 (mutable and immutable types in python)
- [zz]How to use *args and **kwargs in Python
- python inconsistent use of tabs and spaces in indentation
- [Python] How to pack and unpack variables in Python?
- Decorators for Functions and Methods in python
- [比较编程]Sorting in Ruby and Python
- Modulo in Python and C
- python中下划线,双下划线,首尾双下划线的区别(Difference between _, __ and __xx__ in Python)
- GC in C# and Python
- Leetcode_swap-nodes-in-pairs(c++ and python version)
- How to use *args and **kwargs in Python
- Graham King » In-memory key-value store in C, Go and Python
- install python 3.2, django and eclipse pydev plugin in mac for python devolopment
- Sublime Text 2 for C/C++ and Python in Windows
- Python中使用pickle对内建类型(built in types)进行对象序列化(object serialization and deseirialzation)
- 如何在python中使用*args,**kwargs (How to use *args and **kwargs in Python)
- How to use *args and **kwargs in Python
- Proxy and State in Python