posted on 2023-05-07 19:47 read(920) comment(0) like(2) collect(1)
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.
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;
Usually just download the latest one, click to enter version 3.11.3;
Find the installation file to download;
After the download is successful, it is such a .exe tool, double-click to run;
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;
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;
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.
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.
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;
After the download is successful, it is such a .exe tool, double-click to run;
The operation method is very simple, keep clicking Next;
After the installation is successful, search for "Anaconda" in the start menu, and you can see the content of its installation;
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;
In the "Environments" option, you can see some libraries commonly used by python;
编辑器
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. PyCharm
In 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.
After the download is successful, it is such a .exe tool, double-click to run;
Then go to the next step;
After successful installation, run PyCharm, the initial interface is as follows;
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;
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.
Next we create a new python project;
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;
main.py is a python file created by default for me;
So far, the python development environment has been set up.
- Book delivery in this issue: "Metaverse Ⅱ" (all three volumes: graphic meta-technology block chain + meta-assets and Web 3.0 + meta-humans and Utopia)
Author:kkkkkkkkkkdsdsd
link:http://www.pythonblackhole.com/blog/article/323/fadf39992c85c854f3e4/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!