How do you write Python under Mac? (Build Python development environment)

Source: Internet
Author: User

With the development of many libraries such as NumPy, scipy, matplotlib and pandas, Python has become more and more popular in the fields of data analysis, data mining and scientific computation of massive data, and it is also the most sought-after programming language for data processing. Here is the main explanation mac install Python, and finally introduce the third party Python ide-pycharm.


One, (small Bai Zing) First Mac is the own python ...

All you have to do is:

1. Open Terminal ... There are too many ways to do it (shortcut key shift+command+u Open utility to find terminal or first open launchpad, enter "terminal" in search and press Command+space to search terminal terminal)



2. Enter "Python" to enter the interpreter, such as printing "Hello World." ”。



3. Problem: The MAC system has its own Python environment with the default boot path in:/usr/bin. Python scripts are easy to execute, but certainly not enough for Python development, and you need to install Anaconda.

So what is anaconda. Why you can run Python and install Anaconda.


Second, (upgrade version) and install Anaconda

1. What is Anaconda.

In simple terms, Anaconda is a package manager and an environment manager that comes with a number of scientific data modules such as Conda, Python, and support for scientific computing and analysis, and when different projects need to be used for various versions of Python, or different versions of the package, Conda can create different operating environments for different projects, so also known as environment managers; Anaconda also includes two different styles of editors jupyter and Spyder.

2.Mac How to install the Anaconda.

(1) directly to the official website download OS X under the corresponding version of Anaconda, here Select the Python2.7 corresponding installation package.

(2) Open the terminal, enter the following command, execute batch instructions:

$ bash~/downloads/anaconda2-4.0.0-macosx-x86_64.sh

Next is the fool installation, Enter,yes ...

(3) After the installation is successful, execute the following command to load the anaconda position to the beginning of the environment variable path, making it a priority to use Anaconda version later in Python.

$ export Path= "$HOME/anaconda2/bin: $PATH"

(4) Finally you can enter Python directly, check the Anaconda version of the Python installation is successful.


Three, (the front is nonsense, have the IDE why not) install a pycharm on OK

1.PyCharm is a versatile integrated development environment that only needs to be run Python in pycharm to create Python file, and Pycharm built-in complete functionality, automatic completion, code hints, debug runs, code editing, correction, optimization, can also automatically combine git for code versioning, when a large project needs to be done with the project management function of the pycharm is most convenient.

2.PyCharm installation is also very simple

Directly into the official website Pycharm:python IDE for Professional developers by JetBrains, point download



Select MacOS Version



Drag Pycharm into the application


Start Pycharm, then there is an activation code problem, on the Internet to see a very magical operation:

Select License Server activation, then fill in: http://artemis.my.to, then click Active to activate.


Finally, there is a small problem, the last step is to install Vim,markdown,bash, such as editor Plug-ins, recommended according to personal code habits, R language Plug-ins can be installed, but also what can be uneasy, clean and fast.










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.