Eclipse+pydev Configuring the Python development environment under Windows

Source: Internet
Author: User

1. Introduction

Eclipse is a Java-based, extensible development platform. Its official downloads include the Java, C + +, Android and many other versions. In addition to this, eclipse can also be used to install plug-ins, including Python, PHP and other language development.

This article is about using the Eclipse and Pydev plug-in to configure the Python development environment, documenting the article so that the next time you encounter a problem, it's easy to find

2. Environment

Os:windows XP 32bits
python:2.7.9
Java:6u34

Win7 32, 64-bit operating systems the following methods are the same.

3. Software Download 3.1 Eclipse download

We can download the Eclipse software by entering the Eclipse website download interface.

Because of the previous development of Android, has been using Indigo SR1.

Also, be aware that you want to select the correct number of system bits (32/64bits).

3.2 Pydev offline download

We can see "Get zip Releases" at the end of the Pydev project download page and click on the SourceForge download page (click here to go directly).

4.Eclipse Installation

Note: The eclipse installation requires a Java environment, and if you do not have a Java environment installed, download and install the JDK first (click here).

Eclipse does not actually need to be installed, just unzip it to the desired place, and double-tap to open the Eclipse.exe. The first time you run, you will be asked to enter a work path.

5.PyDev plug-in installation 5.1 online installation

The method of installing Pydev online is most likely to fail, please choose carefully.

Open Eclipse and select "Help"-"Install New software".

In the popup dialog box, click the Add button to add a new installation source.

Fill in the URL of the installation source (http://pydev.org/updates) at the location, and give it a name to fill in the name, for example, I wrote here is Pydev.

Remove the "Connect all updates sites during install to find required software" option, or you will be networked to search for all possible update sites when installing a new plugin, resulting in an unpredictable installation time. and may cause the installation to fail.

When you are sure you can see a pending process, and then get the plug-in as shown:

When checked, click Next to install.

However, due to network reasons, this method of installing Pydev is likely to fail, prompting for network connection errors.

5.2 Offline Installation

The general use of offline installation is to select the location of the installation source in the 5.1 diagram, select "Archive", and then select the downloaded offline package, such as the installation of ADT, as was the case with the previous Pydev installation.

However, during the recent installation process, it was discovered that this would prompt the error "No software site found at jar:file:[offline package path]!/. wish to edit the location?.

The workaround is to extract the downloaded offline packages directly, get the plugins and features folders, and place them in the eclipse's Dropins directory . Restart the Eclipse,pydev plugin to install successfully.

6.PyDev Plug-in configuration

After installing the Pydev plug-in, it is not working properly, and you need to configure the Python interpreter.

Open Eclipse, select "Window"-"Preferences", find "PyDev", select "Interpreter–python". Click "New" to add the location of the Python interpreter already in the system. After a short period of processing, to get its libraries, buildins and so on.

Of course, you can also according to their own programming habits to pydev some other configuration, here is no longer said.

7. Create a Pydev project

The development environment of Python is already configured, and a new project is created below to test it and it can be run.

Click "File"-"New"-"other", find "PyDev", select "PyDev Project" and click Next. Take a project name, such as Hellopython, as shown in:

Click "Finish" to complete the project creation. You will then enter the Pydev view for Python development.

Here, we'll write the simplest program to test.

Right-click the src directory of the project, select "New"-"PyDev package", create a Python bundle, also named Hellopython here. Then right-click the package, "New"-"PyDev Module", also named Hellopython here.

Double-click Open hellopython.py and add the following code.

#coding =utf-8
print ' Hello ';

Right-click the project, select "Run as"-"Python run", or Ctrl+f11 run the project.

At this point, you can see the results of the project running in the console window below.

This adds the #codign=utf-8 at the beginning of the line, which is necessary in Python development. Reference https://www.python.org/dev/peps/pep-0263/

This article refers to the http://www.pythoner.com/106.html

Thank the author for sharing here.

Eclipse+pydev Configuring the Python development environment under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.