Eclipse+Pydev builds the Python development environment
I mainly focus on the Java language, the Python development environment requirements are not high, only need to meet the daily application, can write some Python scripts, plus more familiar with Eclipse, so in Python development environment IDE choice, so the way of Eclipse. This article describes how to build a simple Python development environment using Eclipse + Pydev, and finally develop a Python script that connects to mysql for queries.
The PyDev profile
The PyDev project implements a powerful Eclipse plug-in that allows users to fully leverage Eclipse for Python application development and debugging. The PyDev project can use Eclipse as a Python IDE.
The PyDev plugin is a convenience for many Python developers. It provides some nice features, such as syntax error prompts, source code editing assistant, Quick Outline, Globals Browser, Hierarchy View, running and debugging, and so on. Based on the Eclipse platform, PyDev has many powerful features and is very easy to use, which makes it more and more popular.
Ready to file
You need to download Eclipse, Python, Pydev and other files before building
- eclipse-java-neon-3-win32-x86_64.zip
Iso.mirrors.ustc.edu.cn/eclipse/tec…
- Python-2.7.18.amd64. msi, here python2 as an example, python3 class is similar.
www.python.org/downloads/r…
- The PyDev 6.0.0. Zip
Zh.osdn.net/projects/sf…
Jdk configuration, version 1.8
- Unzip the JDK to disk C:\software\jdk1.8.0_161 (can be changed to any other directory you want)
- Configuring environment Variables
From my computer, Computer -> Properties -> Advanced System Settings -> Advanced -> Environment Variables -> User variables for XXX.
Variable name javA_HOME, variable value: C:\software\jdk18.. 0_161 Variable name path and value: % JAVA_HOME %\bin Variable name classpath and value:. %java_home%\lib\dt.jar; %java_home%\lib\tools.jar;Copy the code
- Verification test
C:\Users\ljh>java -version
java version "1.8.0 comes with _161"
Java(TM) SE Runtime Environment (build 1.8. 0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
Copy the code
Python – 2.7.18 installation
- Install python2.7.18
Double-click python-2.7.18.amd64.msi and follow the Windows wizard to install. I installed in C:\Python27\
- Configure Python’s environment variables
After the installation is complete, enter the Python command under CMD, and you will be prompted that ‘python’ is not an internal or external command, nor is it a runnable program. You need to add the Python command to the path variable.
- Check the test
C:\Users\ljh>python
Python 2.718. (v27.18.:8d21aa21f2, Apr 20 2020.13:25:05) [MSC v1500. 64 bit (AMD64)] on win32
Type "help"."copyright"."credits" or "license" for more information.
>>>
Copy the code
+ Pydev Eclipse configuration
- Unzip eclipse-java-neon-3-win32-x86_64.zip to C:\software\ Eclipse.
- Create the links and Myplugins folders in the Eclipse directory
3. Continue to create a directory named Pydev in myplugins, and then create a directory named Eclipse in Pydev. Zip to C:\software\eclipse\myplugins\ PyDev \eclipse.4. Create a pydev.link file in the links directory with the following contents
path=C:\\software\\eclipse\\myplugins\\pydev
Copy the code
5. Double-click Eclipse.exe to start, select a default Workplace directory such as C:\ pythonWorkplace, and then go to the main interface of Eclipse.Once inside, you can switch to the Pydev view6. Finally, do the Interpreter configuration for Python
Window->Preferences->PyDev->Interpreters->Python Interpreter->New
At this point, the entire Eclipse+Pydev build Python development environment is complete.