IPYNB file opening and Jupyter/conda python environment switch

Source: Internet
Author: User
Tags jupyter continuum analytics
Configure the Python + Mac development environment:Installation Anaconda and Pycharm (online find the registration code) Double-click the Anaconda icon can be seen: Jupyter,spyder, etc. can be launch, after clicking on Jupyter, all the files in the directory will appear in the Web page. How to open the Ipynb file. In the MAC environment to ensure that Jupyter-notebook can run: Generally check the environment variable path configuration can be, for example:
VI ~/.bash_profile
//Add path (the default installation Anaconda has been rewritten)
# added by Anaconda3 4.2.0 installer
export path= '/users/ Cathar/anaconda/bin: $PATH "
source ~/.bash_profile//personal parental test effective
CD to the directory where codes is located, starting
Jupyer-notebook//You can see all the files in the directory on the Web page and try running them.
How to toggle the Python version.

Python 2, 3 incompatibilities are found when you run the Python command in Jupyter. Originally thought that the switch version is very simple thing, looked at many places still did not find the solution. Tools are installed in a pile. Here's a summary: Pyenv and pyenv-virtualenv: These are the more fabulous versions of the Python Environment management tool. But the biggest flaw is the unrecognized version of Python that has been installed in the previous environment. That is, only through pyenv install installation will enter his management. The second major flaw is that the network environment will lead to complete download installation can not, so in vain. Also, if you use the Anaconda band Jupyter, it is useless to modify the environment variable, do not switch the Python version, unless you install multiple kernel, and then manually switch (the individual is so understanding), you can refer to
The easiest way to avoid trouble is to pyenv install–list view the version that can be installed, and install the following both (which is obviously too unwieldy, which describes how to provide an environment switch by installing kernel).

anaconda-2.4.0  # supports Python 2.6 and 2.7
//anaconda3-2.0.1 # support for Python 3.3 and 3.4
manual installation of IPython kernel and environment switching How to see how many versions of Python the system has.
(1) View Mac system with Python environment in:
$cd/system/library/frameworks/python.framework/versions/
$ls
2.3 2.5 2.6 2.7 Current
//(2) View user Install Python by default installed in:
$CD/library/frameworks///I do not have
///(3) The user installs the Anaconda after the self with the Python environment.
/users/cathar/anaconda/bin
//view currently using the Python version
$which python
/users/cathar/anaconda/bin/python
manually install Jupyter perform background IPython kernel

Reference:
Https://ipython.readthedocs.io/en/latest/install/kernel_install.html

Install different environments by command Python2, Python
$python 2-m ipykernel install--user
$python 2-m ipykernel install--user--name 2.7 Env--display-name "python (2.7env)"
$python-M ipykernel install--user--name 3.5env--display-name "python (3.5env) "
Switch Environment Test
Use Conda to view all environmental information (including the core version of Jupyter page) cathardemacbook-pro:~ cathar$ conda Info--envs # Conda environments: # 2.7env                  /users/cathar/anaconda/envs/2.7env 3.5env/users/cathar/anaconda/envs/3.5env Root */users/cathar/anaconda//* represents the default environment $ python--version python 3.5.2:: Anaconda 4.2.0 (x86_64) $ cd/users/cathar/ Library/jupyter/kernels/cathardemacbook-pro:kernels cathar$ ls 2.7env 3.5env python2//on command line activation environment for different Python versions $ source AC Tivate 2.7env (2.7env) cathardemacbook-pro:kernels cathar$ python python 2.7.12 | Continuum Analytics, inc.| 
(Default, June 2 2016, 17:43:17) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM builds 2336.11.00)] on Darwin Type ' help ', ' copyright ', ' credits ' or ' lic
Ense "for the more information.
Anaconda is brought to your by Continuum Analytics. Please check out:http://continuum.io/thanks and https://anaconda.org >>> (2.7env) Cathardemacbook-pro: Kernels cathar$ Source Activate 3.5env (3.5env) CathardeMacbook-pro:kernels cathar$ python python 3.5.2 | Continuum Analytics, inc.| 
(Default, June 2 2016, 17:52:12)  [GCC 4.2.1 compatible Apple LLVM 4.2 (clang-425.0.28)] on Darwin Type ' help ', ' copyright ', ' credits ' or ' license ' for the more Information.
view installed packages in different environments
$ Conda List
Delete Environment

Reference: Http://conda.pydata.org/docs/using/envs.html#remove-an-environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.