[Python] literacy post: about installing and setting Python on windows, Linux and MAC

python literacy post installing setting

source |Analytics Vidhya


  • stay Linux、Mac or Windows Machine mounted Python Problems encountered in
  • Step by step installation Python And popular data science tools



  • Install... On your machine Python Is it difficult ? This is actually a very common question I see among beginners of Data Science . The installation may look simple in theory , But in reality, there may be some problems .

I'm personally trying to be in my Linux and Windows Machine mounted Python I have encountered all kinds of problems in my life . Generally, the installation goes well before something goes wrong . When something goes wrong, it's either a compatibility issue , Or it's about the lack of some kind of dependency .

If you've ever tried to install on your machine Python I have encountered such trivial problems in my life , So this article is for you . When I have problems, I usually need to find several forums or websites to solve my problems , It's not a good process , So I decided to put everything in order , Put it in one place and share it with you .

I offer a step-by-step process , You can set it up on the following three platforms Anaconda To install Python:

  • Linux
  • macOS
  • Windows



  1. An important tool for Data Science
  2. stay Linux Installation on Python Steps for
  3. stay macOS Installation on Python Steps for
  4. stay Windows Installation on Python Steps for


An important tool for Data Science

The data scientist's toolbox may surprise you , Because different aspects of work may require multiple tools . However , Some tools are more important than others ( Or more widely used ). Here's every data scientist ( Whether novice or experienced ), We all need some essential tools :

  1. Python: Python Is the most widely used programming language in Data Science . Compared with other languages , Almost every new development of machine learning comes first Python In the . The reason it's widely used , Because Python There are some very useful libraries in .
  2. Pandas: In data processing and Analysis , There's nothing like Pandas.Pandas It's a Python library . In general, you need to manipulate the data before performing any analysis or building a machine learning model , It's very useful when manipulating data .
  3. NumPy: and Pandas equally ,NumPy It's also a very popular one Python library .NumPy The function supporting large multidimensional array and matrix is introduced . It also introduces advanced mathematical functions to deal with these arrays and matrices
  4. Matplotlib: Matplotlib yes Python The most popular data visualization Library in . It allows us to generate and build all kinds of graphs
  5. Scikit-Learn: It's like data manipulation Pandas And for visualization Matplotlib equally ,Scikit-Learn He is the best at building practical models
  6. Jupyter Notebook: Jupyter Notebook It's a very useful IDE, You can do data science experiments , It can even document your methods , And create presentations and slides based on your code experiments .

The best thing is Miniconda and Anaconda All of the above tools are configured by default !


What is? Anaconda and Miniconda?

When you study data science ,Python It's a very important software . It allows us to install almost all the libraries and tools , These libraries and tools are what we're using Python What you need for a journey in Data Science . It has a very simple interface , Let's do most data science tasks in just a few lines of code .

Miniconda yes Anaconda A lightweight version of . If you don't have enough disk space on your computer ,Miniconda Is a good choice .

Let's take a look at how to set up... On our own machine at the same time Anaconda and Miniconda!


stay Linux Installation on Python Steps for

Linux It's a popular platform for data science . It gives us great flexibility in our data science tasks . But here's a little warning —— If you are Linux beginner , stay Linux Installing software on a computer can be quite tricky !

The following is in Linux Installation on Python And popular data science tools .

First step : obtain Miniconda

You can download it from the link below Miniconda:


You can choose Linux Version of the installation program , Suggested Python The version should be anything larger than Python 3.5 Version of .

The second step : install Miniconda

Now it's downloaded Miniconda file , The next step is to install it in the system . So , First, go to the download file directory :

cd directory_name

then , To start the installation script , Use bash Command input Miniconda file name :

bash miniconda_file_name

If confirmation is required , Please press enter to continue .

Once you see the license terms , Please continue to press enter key , Until we accept these terms . Then input "yes" Terms of acceptance . Then it will ask you to choose the installation location :

You can provide a separate location , Or press enter Key to select the default location . Unless I have a space problem with my main drive , Otherwise I usually prefer the default option . Here I give another installation location .

After that , The process is quite simple , Because you just need to say "yes" And press Enter Press the key . please remember , The installation may take some time , So when your machine is installing everything , It's time to go for a coffee !

After completing the above steps , You will be asked to open another terminal to activate Miniconda, Open a new terminal , Let's start with the next steps

The third step : Create a new environment

The environment is basically yours " work area ". You can set it as you want . It's very cool !

You can choose the environment Python Version of the library , This can help you control your data science work better .

Now? ,Miniconda The advantage of the environment is It allows you to create multiple such environments . You can manage multiple independent environments , Each environment is used for a separate task !

Let me explain with an example . Suppose we're using a state-of-the-art framework ( For example, for natural language processing PyTorch-Transformers), And we need to rely on all the latest versions of the library . Then there's where the environment comes in handy .

For example, we have an old legacy project , And we were forced to use some version of the library that the project needed . We can make this latest version of the installation with these old versions of the library coexistence .

You can create an environment with the following command :

conda create -n av python=3 anaconda

"av" It's the name of the environment ( You can give it any name you like ).python=3 It's what we want to use python edition .

To check that the environment was successfully created , Please type the following command :

conda env list

This will give us a list of the environments currently installed on the system .

Step four : Activate the new environment

Now? , To start using the new environment you create , Enter the following command :

source activate av

To make sure you work properly in the active environment , We can use the following command to see a list of libraries installed in the environment :

conda list

The above command should give you this output :

Once you've finished working on an environment , You want to stop it , You can use :

source deactivate av

therefore , Now all the settings are done , Next check to see if it works as expected . Let's move on to the next step .

Step five : start-up Jupyter Notebook

open Jupyter Notebook The order is as follows :

jupyter notebook

This will launch... In the browser Jupyter Notebook:

Next , You just click " newly build ", And select "python3", You can start using it python3 Of Notebook 了 :

It's simple , isn't it? ?

congratulations ! Now? , You have successfully installed Anaconda. because Anaconda Default configuration Python And all the data science libraries ( such as Pandas、Numpy、Scikit-Learn etc. ) To provide with , So now your system also includes all these libraries !

If you are still in doubt or stuck at any step , Here's a video of the whole installation process ^1:


stay macOS Installation on Python Steps for

macOS The installation steps of are very similar to Linux Installation steps of . They all have the same bash terminal . The only difference is that you need to download Miniconda The installation files .

You can download it from this link Miniconda for macOS:


This time, , You have to choose macOS "bash installer", Suggested Python The version should be anything larger than Python 3.5 Version of .

After downloading the above file , Just follow Linux In the installation step step 2 To 5 To operate , It's time to start .

Watch Video ^2, Gain in macOS Installation on Python The whole running process of :


stay Windows Installation on Python Steps for

Let's see in Windows Installation on Python And other data science library steps .

First step : obtain Anaconda

You can download it from this link Anaconda:


You can choose to install the program Windows edition , Suggested Python Version should be Python 3.5 Any version of the above .

Now you're going to see that the two choices are 32 position and 64 position Erection sequence . Choose one that is compatible with your system ( If you're not sure , Right click on the " My computer " Check it out. ).

The second step : install Anaconda

After downloading the installation file , go to "Downloads" Folder , Double click on the file . A new installation window will open :

And then click "Next", This will take you into the license agreement . Click on "I Agree" Accept :

then , It will ask if you just want to install the software for that user , Or just want to install this software for all users of the system . It's entirely your choice . I usually choose "recommended( recommend )" Options :

Now you can choose where to install the software :

Now? , In the next window , You're going to get a few " Advanced options ". You can now cancel both options , And then click Install. This step may take some time :

After installation , Click on " next step ":

You can skip installing Microsoft's VSCode:

single click finish.

It's done , At this time Python It's ready for you to start analyzing data and building machine learning models .

The third step : start-up Jupyter Notebook

To make sure everything is installed correctly , We're going to open up Jupyter Notebook. Do that , First go to the start menu and search "Jupyter Notebook":

Click on "Jupyter Notebook" Options , Will open in browser Jupyter Notebook:

Now you just click on "new", And then choose "python3", You can start using it python3 Notebook 了 :

If you prefer to learn through visual formats , Here's a video ^3 It introduces in detail how to use Windows Installation on Python.

Finally, it is pointed out that

That's installing on all popular platforms Python The whole content of . My purpose here is to familiarize you with the installation process , Remove any doubts you may have .

- End -

This article is from WeChat official account. - Beginners of machine learning (ai-start-com)

The source and reprint of the original text are detailed in the text , If there is any infringement , Please contact the [email protected] Delete .

Original publication time : 2021-04-06

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

本文为[Huang Bo's machine learning circle]所创,转载请带上原文链接,感谢

  1. 【计算机网络 12(1),尚学堂马士兵Java视频教程
  2. 【程序猿历程,史上最全的Java面试题集锦在这里
  3. 【程序猿历程(1),Javaweb视频教程百度云
  4. Notes on MySQL 45 lectures (1-7)
  5. [computer network 12 (1), Shang Xuetang Ma soldier java video tutorial
  6. The most complete collection of Java interview questions in history is here
  7. [process of program ape (1), JavaWeb video tutorial, baidu cloud
  8. Notes on MySQL 45 lectures (1-7)
  9. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  10. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  11. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  12. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  13. 【递归,Java传智播客笔记
  14. [recursion, Java intelligence podcast notes
  15. [adhere to painting for 386 days] the beginning of spring of 24 solar terms
  16. K8S系列第八篇(Service、EndPoints以及高可用kubeadm部署)
  17. K8s Series Part 8 (service, endpoints and high availability kubeadm deployment)
  18. 【重识 HTML (3),350道Java面试真题分享
  19. 【重识 HTML (2),Java并发编程必会的多线程你竟然还不会
  20. 【重识 HTML (1),二本Java小菜鸟4面字节跳动被秒成渣渣
  21. [re recognize HTML (3) and share 350 real Java interview questions
  22. [re recognize HTML (2). Multithreading is a must for Java Concurrent Programming. How dare you not
  23. [re recognize HTML (1), two Java rookies' 4-sided bytes beat and become slag in seconds
  24. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  25. RPC 1: how to develop RPC framework from scratch
  26. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  27. RPC 1: how to develop RPC framework from scratch
  28. 一次性捋清楚吧,对乱糟糟的,Spring事务扩展机制
  29. 一文彻底弄懂如何选择抽象类还是接口,连续四年百度Java岗必问面试题
  30. Redis常用命令
  31. 一双拖鞋引发的血案,狂神说Java系列笔记
  32. 一、mysql基础安装
  33. 一位程序员的独白:尽管我一生坎坷,Java框架面试基础
  34. Clear it all at once. For the messy, spring transaction extension mechanism
  35. A thorough understanding of how to choose abstract classes or interfaces, baidu Java post must ask interview questions for four consecutive years
  36. Redis common commands
  37. A pair of slippers triggered the murder, crazy God said java series notes
  38. 1、 MySQL basic installation
  39. Monologue of a programmer: despite my ups and downs in my life, Java framework is the foundation of interview
  40. 【大厂面试】三面三问Spring循环依赖,请一定要把这篇看完(建议收藏)
  41. 一线互联网企业中,springboot入门项目
  42. 一篇文带你入门SSM框架Spring开发,帮你快速拿Offer
  43. 【面试资料】Java全集、微服务、大数据、数据结构与算法、机器学习知识最全总结,283页pdf
  44. 【leetcode刷题】24.数组中重复的数字——Java版
  45. 【leetcode刷题】23.对称二叉树——Java版
  46. 【leetcode刷题】22.二叉树的中序遍历——Java版
  47. 【leetcode刷题】21.三数之和——Java版
  48. 【leetcode刷题】20.最长回文子串——Java版
  49. 【leetcode刷题】19.回文链表——Java版
  50. 【leetcode刷题】18.反转链表——Java版
  51. 【leetcode刷题】17.相交链表——Java&python版
  52. 【leetcode刷题】16.环形链表——Java版
  53. 【leetcode刷题】15.汉明距离——Java版
  54. 【leetcode刷题】14.找到所有数组中消失的数字——Java版
  55. 【leetcode刷题】13.比特位计数——Java版
  56. oracle控制用户权限命令
  57. 三年Java开发,继阿里,鲁班二期Java架构师
  58. Oracle必须要启动的服务
  59. 万字长文!深入剖析HashMap,Java基础笔试题大全带答案
  60. 一问Kafka就心慌?我却凭着这份,图灵学院vip课程百度云