"Introduction to the author": CSDN top100, Alibaba Cloud blog expert, Huawei cloud share expert, high-quality creators in the field of network
security
PyCharm
1. Download and install PyCharm
1) Visit the official website https://www.jetbrains.com/pycharm/download/#section=windows
to download the "Community Edition" installation package.
2) After the download is complete, "double-click" to run the installation package to start the installation.
3) Setting interface, click Next
4) After selecting the installation location, click Next
5) In the installation setting interface, after checking all 4, click Next
6) Select the menu folder interface, keep the default, click Install
7) Choose to restart manually later, click Finish
8) An icon appears on the desktop, and the PyCharm installation is complete.
If your computer "does not have a Python environment" , you also need to download a Python.
2. Download and install Python
1) Visit the official website https://www.python.org/
, select Downloads , select Windows , click Python 3.11.3 , and download Python
2) After the download is complete, double-click to install
3) Check Add python.exe to PATH , the environment variables will be automatically configured, click Install Now
4) Wait for the progress bar to finish, the installation is successful, click Close
5) Enter python in any path of cmd, and the following interface will be displayed, indicating that "environment variable configuration is complete" .
3. Create a project
1) Double-click the icon, agree to the unequal treaty, and click Continue
2) Data sharing interface, click Don't Send
3) Click New Project to create a new project
4) Select the project path, select the Python environment (that is, the Python we installed in Chapter 2), and click Create
5) A test project is provided by default, right-click Run 'main' and run
6) Output the following, indicating normal.
4. Install the module
When using PyCharm in the early stage, you often encounter the error of No module named “xxx” . This is because Python does not have the module you use by default and needs to be imported manually.
1. pip installation
In any path of cmd, execute pip install xxx
, and replace xxx with the full module name.
pip list
View installed modules
By default, pip downloads modules from foreign servers. If you encounter WARNING: Retrying (Retry(total=1,
it may be because you use a "network proxy" . If you are too lazy to turn off the network proxy ,
you can specify the image of Alibaba Cloud and add trust site, the command is as follows:
pip3 install xxx -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
2. PyCharm installation
1) Upper left corner - [File] - [Setting...]
2) [Project: pythonProject] - [Python Interpreter] - You can see the installed modules on the right, click the plus sign in the upper left corner
3) In the opened window, search for the module and click [Install Package] to download it.