Master the installation and use of Python, Anaconda, PyCharm in one article

insert image description here
This article will introduce the construction and basic use of a more comprehensive Python development environment, including the installation and use of the Python interpreter, the installation and use of the PyCharm editor, the installation and use of Anaconda, and the use of the library management tool pip.

PyCharm + Anaconda is a very complete Python development environment, and it is also the development method used by most developers. Both experienced developers and beginners are a must.


1. Download and install the Python interpreter

To use the Python language for development, you need to install Python first 解释器. The role of the Python interpreter is to interpret the Python source high-level language into binary machine language. Usually we say that installing Python actually means installing the Python interpreter.

Enter the Python interpreter download address (https://www.python.org/downloads/) , and select the interpreter corresponding to the system;

insert image description here
Usually just download the latest one, click to enter version 3.11.3;

insert image description here
Find the installation file to download;

insert image description here
After the download is successful, it is such a .exe tool, double-click to run;

insert image description here
After running, enter the installation interface, select automatic installation, remember to check "Add python.exe to PATH" before clicking install, that is, add Python to the environment variable, and you don't need to add it manually later;

insert image description here
After the installation is successful, search for "Python" in the start menu, and you can see the content of its installation, which contains four files in total;

insert image description here

2. Library management tool pip

The biggest advantage of Python is that it has a rich library, and through its library management tool pip(package installer for Python), many libraries can be installed, uninstalled, and updated.

insert image description here

It should be noted that the interpreter of Python version 3.4 or later comes with the pip tool. If we install the interpreter of version 3.4 or later, there is no need to manually install pip. If you need to install, you can go to the URL ( https://pypi.org/project/pip/ ) to download.

3. Download and install Anaconda

Anaconda is an open source Python distribution that contains more than 180 scientific packages such as conda, Python, and their dependencies. If we have installed Anaconda, there are many third-party libraries that do not need to be installed manually using the pip command, because they have been integrated in Anaconda, and the development efficiency will be greatly improved.

The download of Anaconda is very simple, just go to the official website ( https://www.anaconda.com/ ) and download directly;

insert image description here
After the download is successful, it is such a .exe tool, double-click to run;

insert image description here
The operation method is very simple, keep clicking Next;

insert image description here
After the installation is successful, search for "Anaconda" in the start menu, and you can see the content of its installation;

insert image description here
Open the main page of "Anaconda Navigator" as follows, you can see that some tools have been installed for us, and they can be used directly;

insert image description here
In the "Environments" option, you can see some libraries commonly used by python;

insert image description here

4. Download and install PyCharm editor

编辑器That is, the tool we use to write code specifically. There are many Python editors, including IDLE that comes with the Python interpreter, Jupyter Notebook based on ipython, and editors mainly for the Python language such as PyCharm, Spyder, and WingIDE. In addition, development tools such as VSCode and Sublime also support Developed in Python. PyCharmIn this article, we will demonstrate the operation. Compared with the IDLE that comes with the Python interpreter, PyCharm has more comprehensive functions and a better experience in all aspects.

Enter the PyCharm editor download address ( https://www.jetbrains.com/pycharm/download/#section=windows ), and also select the corresponding system version to download. There are two versions of Professional Professional Edition and Community Community Edition to choose from. As an individual developer, you can choose the Community Edition because it is free.

insert image description here
After the download is successful, it is such a .exe tool, double-click to run;

insert image description here
Then go to the next step;

insert image description here
After successful installation, run PyCharm, the initial interface is as follows;

insert image description here
We must know that PyCharm is just an editor, which only allows us to write code but not to execute and interpret code. So you need to associate the python interpreter in this editor. Click New Project;

insert image description here
Configure the Python interpreter we have downloaded in the position of the basic interpreter "Base interpreter", which is usually automatically configured, as long as you see the address displayed here.

insert image description here
Next we create a new python project;

insert image description here
After the creation is successful, the project file structure is as follows, select the project name and right click, and create a new python file for the development project;

insert image description here
main.py is a python file created by default for me;

insert image description here
So far, the python development environment has been set up.


Recommended in this issue

  • Book delivery in this issue: "Metaverse Ⅱ" (all three volumes: graphic meta-technology block chain + meta-assets and Web 3.0 + meta-humans and Utopia)
  • Book Donation Event: Please click here for event details

insert image description here

Guess you like

Origin blog.csdn.net/weixin_53072519/article/details/130106877