Python development Environment (1): Eclipse+pydev plugin

Source: Internet
Author: User


Tag: It's your own failure. COM Pack related ... bubuko line modification



 Laptop Pro 15.6 inch (I5-8250U), operating system: Windows 10,JDK Version: 1.8.0_152 (environment variable configured)






Step 1. Download eclipse



Based on my CPU model, the 64-bit version is selected.



After the successful download, unzip to the directory of your choice, my is the D disk.









Step 2. Run Eclipse, install Pydev



Run Eclipse (first open will set workspace, etc.);



Open the menu help under Eclipse Marketplace ... ;






Search for Pydev, click Install under Pydev;






Default Select all, click Confirm;






Two licenses, must accept-its content can be copied out, check the commerical clause (I did not see), and then click the Finish button to complete the installation;






After installation, the restart confirmation dialog pops up and the Eclipse,pydev plugin can be restarted to develop a Python program in Eclipse.









Step 3: Build a Python project



Open Eclipse, select Project under Menu New ... ;



Since the Pydev was just installed, the creation of the Python-related project does not appear in the Menu New submenu.






There will be a Pydev node in the Wizards of the Open New Project dialog box, with three options for three Python projects respectively;



You can only use PyDev Django project (Web project), PyDev Project two projects if your network cannot open Google search.






Select Pydev Project to build a Python project: Enter project name, configure project type--Select Python, select Interpreter version, and so on;






Manual selection interpreter--can be modified by menu window->preferences.






Python 3.6 selected (installed on the C drive);









After configuration, click the Apply and Close button to return to the new Project menu;






The meaning of several radio boxes is unclear, and the last "Don t configure ..." Item is selected;



In the configuration working sets, the location of the new project-selected by default in the workspace under Eclipse;



After the configuration is complete, click the next> button to enter the reference Page ( not clear how to configure );






The meaning of the pop-up menu below is also unclear;






Finally, click the Finish button to complete the new project: At this point Eclipse has two projects, of which the zl0425 is a clear project to be established, the other meaning is unclear;






You can see the new two items in the workspace in the Eclipse root directory;









Step 4: Build a Python program test--Print out Hello, kitty!



Create a program to complete the task in the new project above.



Because the project has no source directory (what to do with it?) Why to build? ), so the source directory needs to be established first;






Then build the Python module under the source directory src (you can also build the package first);






Enter code and execute (with auto-complete function);






failure: The execution of the program failed on the first established program and did not get the expected result because the Python file is encoded as inheriting GBK, not UTF-8;






The code of Python program is UTF-8, some garbled characters appear in the program;



Execute the program again and still fail!









Workaround : Delete the created Python program files and re-establish the program files. However, before you create a new program, the code for the modified item is UTF-8.












Then re-establish the program, then execute the program, at this time, the program executes successfully, completed our task, and then we can go to lunch!









Very good!






Questions:



As for the coding of the project and the preferences of eclipse, we need to find some information.



There are pydev to develop the structure of the Python program, the Source Folder, the package how to set the reasonable and efficient, but also need to find information;






Many of the problems are due to the lack of familiarity with the eclipse development process and unfamiliar with the development processes of Python and Pydev.






Python development Environment (1): Eclipse+pydev plugin


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.