You can learn python on mac system. Here I will introduce how to install python on mac:
1. mac comes with python
All you have to do is:
1. Open the terminal...there are too many ways (shortcut key shift command U to open "Utility" Tools" to find the terminal or open launchpad first, enter "terminal" in the search or press command space to enter the search interface to search for the terminal)
2. Enter "python" and press Enter Then enter the interpreter, for example, print "hello world!".
3. Question: The default startup path of the python environment that comes with the Mac system is: /usr/bin. You can easily execute python scripts here, but it is definitely not enough for python development. You also need to install Anaconda.
So what is Anaconda? Why do I need to install Anaconda when I can run python?
Related recommendations: "python Video Tutorial"
2. Install Anaconda
1. What is Anaconda?
Simply put, Anaconda is a package manager and environment manager. It comes with multiple scientific data modules such as conda and python to support scientific computing and data analysis; in addition, when encountering different projects, you need to use different When using different versions of python or different versions of packages, conda can create different running environments for different projects, so it is also called an environment manager; Anaconda also includes two different styles of editors, Jupyter and Spyder.
2. How to install Anaconda on Mac?
(1) Go directly to the official website to download the corresponding version of Anaconda under OS X. Here, select the installation package corresponding to Python2.7.
(2) Open the terminal, enter the following command, and execute the batch command:
$ bash~ /Downloads/Anaconda2-4.0.0-MacOSX-x86_64.sh
The next step is to install it for fools, enter, yes...
(3) After the installation is successful, execute the following command to load the location of Anaconda to the beginning of the environment variable PATH, so that it will be used first when using python in the future. Anaconda version.
$ export PATH="$HOME/anaconda2/bin:$PATH"
(4) Finally, you can directly enter python to check whether the Anaconda version of python is installed successfully.
3. Install PyCharm
1. PyCharm is a multi-functional integrated development environment. You only need to create a python file in pycharm to run python, and pycharm has complete built-in It has functions such as automatic completion, code prompts, debugging and running, code editing, correction, and optimization, and it can also automatically combine with Git for code version control. When you need to do a large-scale project, it is most convenient to use PyCharm with project management functions.
2. The installation of PyCharm is also very simple
Go directly to the official website PyCharm: Python IDE for Professional Developers by JetBrains, click download
Select the macOS version
Drag PyCharm into the application
Start PyCharm, and there will be an activation code Question, I saw a very magical operation on the Internet:
Select License Server to activate, then fill in: http://artemis.my.to, and then click Active to activate.
The above is the detailed content of Can I learn python on mac system?. For more information, please follow other related articles on the PHP Chinese website!