Problems I encountered in Python learning I encountered in python Learning
Development Tool: PyCharm
System: macOs Serria 10.12.4
Jetbrains, produced by jetbrains, is a brother product of idea and continues the ease of use of idea, and the operation buttons are basically the same.
I. execution environment problems
1. py executable Virtual Environment Settings
By default, simple code or function calls written in Python can be executed right-click, as shown in figure
The common problem is that the execution environment is switched. Because Python2 and Python3 are completely different versions and do not have an inheritance relationship, some code can only run on Python2, some of them can only run on Python3. Therefore, our project may need two environments for execution. to modify the execution environment of the current project, refer to the following:
Here, you can set up a separate virtual execution environment, or even multiple. Generally, you are not recommended to directly use the built-in execution environment of the system to re-download or install an independent new environment, in this way, when the project code needs to install a new dependent package, the installation will not have any permission issues, if a built-in execution environment is used, unpredictable impact may occur to other functions or applications during the modification process.
During configuration, the Location is automatically processed according to the project's Location, and the Location of the Python execution environment that has been downloaded and installed is directly selected at the Base interpreter Location.
After the configuration is complete, an independent execution environment will come out.