Setting up a Python Development Environment in Eclipse

Corey Schafer · Beginner ·🛠️ AI Tools & Apps ·10y ago

Key Takeaways

The video demonstrates how to set up a Python development environment in Eclipse using the PyDev plugin, covering installation, configuration, and customization of the IDE for Python development.

Full Transcript

hey everybody how's it going in this video we will learn how to set up a python development environment using the Eclipse IDE and the piev plug-in um so if you've watched my videos before then you've probably noticed that I do a lot of my Python Programming within a text editor called Sublime Text now the reason that I use that for my tutorials is because it's nice and clean and there's not a lot of other bells and whistles that are getting in the way and it really allows us just to uh Focus on the code but an IDE which is an integrated development environment uh it does have some advantages over a text editor so for example if you want to debug your code then Eclipse will allow us to set break points and uh and step through line by line in our code and print out variables and step into functions and a lot of different um things that we just can't do in a text editor um so in this video we will get Eclipse installed and also get a python environment set up to where we can begin writing python code so right now I'm over here on the eclipse website and um so the first thing that we're going to do is install this Eclipse installer so let's go ahead I'm going to Mac so I'm going to download this Eclipse installer it's going to take us to the another download page here and I'm just going to click this download link here and it will take you to a uh donation page eclipse is open source software so if you have the money to make a donation then I'm sure they' appreciate it but if uh if not then we can just wait for our download to finish okay so that download has finished so I'm going to go ahead and open up this Eclipse installer okay now first thing when you open up the eclipse installer uh right off the bat you might see this over here that says that it needs an update so let's go ahead and run that update and it'll restart the installer for us okay so now we've restarted that installer now this is the point where some people get confused because there's not a specific version of eclipse just for python right out of the box so you can see here that we have an eclipse ID for Java developers for C and C++ PHP um and all these different things now a lot of people will just download the Java developers version and then add in all the python stuff after that on their own um and it does come with some uh it already does come with a get client and the marketplace and things like that um but really I uh don't like that extra overhead so kind of what I like to start with whenever I'm doing python development is just to start with the eclipse platform and you can see here that it says that this package contains the absolute minable IDE suitable only as a base for installing other tools um and that's what we want to do we're going to install a python um environment on top of this so I'm going to go ahead and choose that platform and you can choose the Java version if you'd like and everything will still work just fine um but now that we're in here I'm just going to accept these defaults it's going to install the Java jvm and then the installation folder you can choose where it installs Eclipse so I'm just going to choose install here and let this finish now once this finishes here I'm just going to go ahead and launch this and when it first pops up it may ask us a couple of things so for example it's going to ask us ask us to select a workspace and this is where it will uh put all of our projects and files so I'm just going to accept this default location here and so now we have a new version of eclipse here so I'm just going to uh maximize this and then I'm going to click on go to workbench here okay so now that we're within here uh now we want to install piev piev is a plugin which will allow us to do python development um so for example right now right out of the box if we go up here go file new project you can see here that all we have is this General project here there's nothing that is python specific so to fix this let's go to help and we want to install new software now the new software that I'm going to install is one called Marketplace um now this is something that allows us to install uh things in the future a little bit more easily now Marketplace comes installed already if you were to choose the Java version but from where we started from just the bare minimum Eclipse platform uh we need to install the marketplace so I'm just going to choose all available sites here for what to work with and then I'm just going to search for market and it should find that for us so it's here under general purpose tools Marketplace client so I'm going to go ahead and choose that and then walk through this installation process and go ahead and accept these terms and choose all the defaults so now it is installed and it says that we need to restart Eclipse that's probably going to happen a few times while we're doing this so let's go ahead and do that so now that we have restarted Eclipse we should have the uh Marketplace installed so now if we click on help instead of going to install new software let's go ahead and click on this Eclipse marketplace now the marketplace is just a more visually appealing uh area to download new software rather than the uh where we were before where we had to manually look through all those different sites for the M Marketplace and things like that so what we want to install here in the marketplace is piev now we can either search for it uh but it's also very popular so we just if we just click on this popular tab then it should just be the third or fourth one down from the bottom and you can see uh you can also install whatever else you want here you can see that there are some color themes uh some ways to integrate Eclipse with subversion um so if we scroll down here you can see that piev I think it was like the fifth one down so we can just click install here and it's going to tell us uh all the things that we need to install with this so let's go ahead and click confirm and let this run through now I'm going to go ahead and accept these terms and click finish and now this may take a while to install here I'm going to go ahead and trust these certificates and click okay now once that is finished installing then we'll have to restart Eclipse again so let's go ahead and do that okay so now we have piev installed so we should be able to go to file new project like we did before but now instead of just general here we have this piev option and if we um go down in into here we can see that we can make a Jango project we can make a Google Google app engine project or just a piev project and this is just for your regular python projects so I'm going to choose piev project and click next and then I'm just going to call this project name uh demoore project and then we can Cho use all of the defaults here you can see that's it's going to put it into our workspace here we can choose our python version that we want to use I'm just going to leave it at 2.7 now it may choose an interpreter for you but it may uh say that you don't have an interpreter selected so what I'm just going to do here is click on please configure an interpreter and just let it autoc config it's just going to choose my default python interpreter so that may have already selected the default interpreter for you but if it didn't then you can just click on U that link that I clicked on and uh click on the Quick Auto configuration and it should set the default interpreter for you so for everything else I'm just going to leave the defaults and click finish and now this is going to pop up and say that this kind of project is an is associated with the piev perspective do you want to open this perspective now uh I'm just going to click on remember my decision and hit yes and I usually recommend that you open up the piev perspective because um it lays out all your windows here in the way that um they believe is best for python development and if you don't entirely like the layout then you can always customize it yourself later on um so now we have this demo project here and I'm just going to right click on this demo project and go to new and now you can see that we have uh file but instead of file I'm going to choose piev module so now this is another case where an IDE kind of comes in handy over a text editor because this can set up a lot of stuff for us so for example if I want to put my module directly inside of a package so I can just do a testore package as the name of the package that I want to put it in and you can see here it's going to say note package not found which which mean it it doesn't exist yet and that they will create it for us so now the name of my module I'm just going to call this test module and uh I don't think you need to put the pi yeah so it says that the name may not contain any dots so it'll put the pi extension on for you so just call it uh test module or whatever you want to call it and click finish and then it's going to C uh pop up with some preferences here and I'm just going to leave these defaults and click okay and now it's going to ask us if we want to use a template so uh if we use the empty template then it's just going to uh put the the timestamp at the top of the file but if you're going to write a class or something like that then you can choose the class template and it'll fill in a lot of boilerplate code for you like it'll put the um the dunder and it function in for you and uh and things like that but I'm just going to choose the empty template and you can make your own templates also if you have a specific way that you like to make new files but for now I'm just going to hit and um you may see this pop up to read documentation for pev I'm just going to click on show later okay so now I have my newly created uh test module and you can see that it did add in uh the date and the author here um and you can also see over here on the right within our project that when we put this within a package it went ahead and made the uh init file for us over here and everything like that so it's nice that it went ahead and made all the files that we need in order to make this a package um so now we should be ready to write some code here so if I just do a print uh hello world now I am in Python uh 27 still so uh the print function is going to look like this and now I can just go ahead and run this code when I run it it's going to ask me if I want to run it as a python or as a unit test so I'm just going to choose python click okay and now you can see that it ran our code here and it's showing the output within the cont console so really if you wanted just a basic python uh setup in Eclipse then you should be done you can go ahead and do whatever it is that you need to do uh but I'm also going to show you some of my um uh more favorite preferences here so for example the first thing I'm going to do is change the font and make it a little bit bigger and I also like dark themes uh just because uh whenever I'm looking at a computer sometimes these really bright themes uh kind of hurt my eyes after some time um so for here for the theme instead of Mac I'm going to choose dark and for the color and font theme I'm also going to choose well I'll just leave that at default and click apply and see how this looks okay so that looks good there with the Dark theme and now I'm also going to expand the appearance here and go on colors and fonts and for the basic font which will control this font in here um I'm going to scroll down and the text font is what you want want to change to change uh the font within um your source code editor here so I'm going to edit this and I'm going to use uh source code Pro and I'm going to set this just so you guys can see better I'm going to choose size 18 for now and apply that and click okay and actually I'm going to open up these preferences one more time and uh show you guys um it looks like this font got set to something else here maybe I don't have source code Pro installed on this machine or my uh um uh clicks are just kind of moving around here funny uh okay so yeah that's what I wanted there now there are also some piev specific preferences that we can run so if we look over here in the right we have this piev option so if I uh expand this then within editor I'm going to open this up now within here you can specifically choose how you want uh certain things to look as far as your decorators and numbers and things like that um but really uh the one thing that I like to select whenever I uh first um install Clips is to go in here to code style and then code formatter and I like to automatically set my code to be autop pep 8 compliant so I'm going to click this um use autop pep 8 for code formatting now if there are any I don't know you don't if you don't know what autop pep eight is it's not a big deal but it's just a way to uh kind of check your code for certain um in to make your code more consistent and also uh if there's anything that you want to ignore with auto Pepe you can look all these up online um then you can put in your ignores here so if there's certain errors that you want to skip over then you can do this-- ignore uh within here and set it up that way now I'm also going to click here on Save actions and uh it says that the apply save actions um I'm going to do an auto format editor contents before saving now what this means is that I don't have to uh what it's just going to uh autof format all of the code um right before I save the code so now I'm going to go down here to apply and click okay and then click okay here so now for example if I go to write a function and do a test function here and then just pass this and then do a test to function and then go to save it now let me put in the passcode here as well and now you can see whenever I save that it uh automatically put in the spacing between these two different functions so I like that auto pep8 uh selection if you don't like it then you can turn it off but uh it's nice whenever you're working on large projects for everybody to have all their spacing and everything like that consistent so that about does it for the basic python setup within eclipse that I wanted to show you guys um now if you do want to install more software then I would give the marketplace a look um you know Eclipse has a lot of different plugins so they have plugins for uh git if you want to use uh some git functionality within Eclipse um they have other color themes that you can choose from uh this default color theme here it isn't the one that I usually use I usually uh install some other ones um that look a little bit better so if you want to look at any of those then you can just uh do a search here if I just type in um color then some stuff will come back and also I would give the uh popular tab a look because if you click on the popular tab then these are some of the more um popular color themes and also um like I said some of the plugins that people frequently use like this so this one is for subversion and they also have this moonrise Dark theme that is uh likely a little bit different than this dark theme here so I would definitely give all those a uh look all those over and uh try to set this up to the way that you like it but that about does it for this video um if you have any questions about this stuff just ask in the comment section below uh be sure to subscribe for future videos I uh maybe I'll make some videos on how to debug projects within eclipse and things like that so hopefully you all found this uh video useful and thank you for watching what

Original Description

In this video, we will be setting up a Python development environment in Eclipse using the PyDev plugin. If you've watched my videos before, you have likely noticed I use the Sublime Text text editor for the tutorials. I use this for the videos because it is very clean and easy to use without all the bells and whistles of a full blown IDE. But there are times when an IDE is extremely useful. For example, if you need to debug your application, an IDE is likely what you would like to use. There are several other options out there for Python IDEs. But Eclipse is free open source software. It can also be used to program in several other languages. Let's go ahead and get started on setting up our Python dev environment in Eclipse. ✅ Support My Channel Through Patreon: https://www.patreon.com/coreyms ✅ Become a Channel Member: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join ✅ One-Time Contribution Through PayPal: https://goo.gl/649HFY ✅ Cryptocurrency Donations: Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3 Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33 Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot ✅ Corey's Public Amazon Wishlist http://a.co/inIyro1 ✅ Equipment I Use and Books I Recommend: https://www.amazon.com/shop/coreyschafer ▶️ You Can Find Me On: My Website - http://coreyms.com/ My Second Channel - https://www.youtube.com/c/coreymschafer Facebook - https://www.facebook.com/CoreyMSchafer Twitter - https://twitter.com/CoreyMSchafer Instagram - https://www.instagram.com/coreymschafer/ #Python
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Corey Schafer · Corey Schafer · 58 of 60

1 Web fonts using CSS Font Face
Web fonts using CSS Font Face
Corey Schafer
2 Using Font Awesome in Desktop Applications (OS X)
Using Font Awesome in Desktop Applications (OS X)
Corey Schafer
3 Sublime Text 2: Setup, Package Control, and Settings
Sublime Text 2: Setup, Package Control, and Settings
Corey Schafer
4 ArcGIS API for JavaScript Part 1: Our First Web Map
ArcGIS API for JavaScript Part 1: Our First Web Map
Corey Schafer
5 Mac Tip: Windows' Snapping Feature on Mac with HyperDock
Mac Tip: Windows' Snapping Feature on Mac with HyperDock
Corey Schafer
6 Linux/Mac Terminal Tutorial: Creating Aliases for Commands
Linux/Mac Terminal Tutorial: Creating Aliases for Commands
Corey Schafer
7 ArcGIS API for JavaScript Part 2: Starting Templates
ArcGIS API for JavaScript Part 2: Starting Templates
Corey Schafer
8 Paver Patio Time Lapse
Paver Patio Time Lapse
Corey Schafer
9 Mac Tip: Ways to perform Screen Capturing and Screenshots
Mac Tip: Ways to perform Screen Capturing and Screenshots
Corey Schafer
10 WordPress Plugins: Imsanity
WordPress Plugins: Imsanity
Corey Schafer
11 WordPress Tips: Test your theme with Theme Unit Test and Monster Widget
WordPress Tips: Test your theme with Theme Unit Test and Monster Widget
Corey Schafer
12 Sublime Text 3: Setup, Package Control, and Settings
Sublime Text 3: Setup, Package Control, and Settings
Corey Schafer
13 Understanding Binary, Hexadecimal, Decimal (Base-10), and more
Understanding Binary, Hexadecimal, Decimal (Base-10), and more
Corey Schafer
14 Mac Tip: Adding Folder Stacks to the Dock
Mac Tip: Adding Folder Stacks to the Dock
Corey Schafer
15 CSS Tips and Tricks: Add External URLs to Print Stylesheets
CSS Tips and Tricks: Add External URLs to Print Stylesheets
Corey Schafer
16 JavaScript Arrays: Properties, Methods, and Manipulation (Part 7 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 7 of 7)
Corey Schafer
17 JavaScript Arrays: Properties, Methods, and Manipulation (Part 1 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 1 of 7)
Corey Schafer
18 JavaScript Arrays: Properties, Methods, and Manipulation (Part 5 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 5 of 7)
Corey Schafer
19 JavaScript Arrays: Properties, Methods, and Manipulation (Part 4 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 4 of 7)
Corey Schafer
20 JavaScript Arrays: Properties, Methods, and Manipulation (Part 3 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 3 of 7)
Corey Schafer
21 JavaScript Arrays: Properties, Methods, and Manipulation (Part 2 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 2 of 7)
Corey Schafer
22 JavaScript Arrays: Properties, Methods, and Manipulation (Part 6 of 7)
JavaScript Arrays: Properties, Methods, and Manipulation (Part 6 of 7)
Corey Schafer
23 Python Tutorial: if __name__ == '__main__'
Python Tutorial: if __name__ == '__main__'
Corey Schafer
24 Sublime Text Quick Tip: "Go To Definition" Click Shortcut
Sublime Text Quick Tip: "Go To Definition" Click Shortcut
Corey Schafer
25 How to quickly create favicons for the desktop, Apple/Android devices, tablets, and more
How to quickly create favicons for the desktop, Apple/Android devices, tablets, and more
Corey Schafer
26 Easily Resize Multiple Images Using Picasa
Easily Resize Multiple Images Using Picasa
Corey Schafer
27 Easily Resize Multiple Images Using the Mac Terminal
Easily Resize Multiple Images Using the Mac Terminal
Corey Schafer
28 Python Tutorial: virtualenv and why you should use virtual environments
Python Tutorial: virtualenv and why you should use virtual environments
Corey Schafer
29 Python Tutorial: pip - An in-depth look at the package management system
Python Tutorial: pip - An in-depth look at the package management system
Corey Schafer
30 Git Tutorial: Using the Stash Command
Git Tutorial: Using the Stash Command
Corey Schafer
31 How Software Engineers, Developers, and Designers can volunteer their skills
How Software Engineers, Developers, and Designers can volunteer their skills
Corey Schafer
32 Git Tutorial: Diff and Merge Tools
Git Tutorial: Diff and Merge Tools
Corey Schafer
33 Git Tutorial: Change DiffMerge Font-Size on Mac OSX
Git Tutorial: Change DiffMerge Font-Size on Mac OSX
Corey Schafer
34 Sublime Text Quick Tip: Launch Sublime Text from the Terminal
Sublime Text Quick Tip: Launch Sublime Text from the Terminal
Corey Schafer
35 Python Tutorial: str() vs repr()
Python Tutorial: str() vs repr()
Corey Schafer
36 Programming Terms: DRY (Don't Repeat Yourself)
Programming Terms: DRY (Don't Repeat Yourself)
Corey Schafer
37 Programming Terms: String Interpolation
Programming Terms: String Interpolation
Corey Schafer
38 Programming Terms: Idempotence
Programming Terms: Idempotence
Corey Schafer
39 Python Tutorial: Namedtuple - When and why should you use namedtuples?
Python Tutorial: Namedtuple - When and why should you use namedtuples?
Corey Schafer
40 Programming Terms: Mutable vs Immutable
Programming Terms: Mutable vs Immutable
Corey Schafer
41 Python Tutorial: Else Clauses on Loops
Python Tutorial: Else Clauses on Loops
Corey Schafer
42 Overview of Online Learning Resources
Overview of Online Learning Resources
Corey Schafer
43 Mac OS X Terminal Tutorial: Time-Saving Keyboard Shortcuts
Mac OS X Terminal Tutorial: Time-Saving Keyboard Shortcuts
Corey Schafer
44 Git Tutorial for Beginners: Command-Line Fundamentals
Git Tutorial for Beginners: Command-Line Fundamentals
Corey Schafer
45 Quickest and Easiest Way to Run a Local Web-Server
Quickest and Easiest Way to Run a Local Web-Server
Corey Schafer
46 Python Tutorial: Generators - How to use them and the benefits you receive
Python Tutorial: Generators - How to use them and the benefits you receive
Corey Schafer
47 Python Tutorial: Comprehensions - How they work and why you should be using them
Python Tutorial: Comprehensions - How they work and why you should be using them
Corey Schafer
48 Chrome Quick Tip: Quickly Bookmark Open Tabs for Later Viewing
Chrome Quick Tip: Quickly Bookmark Open Tabs for Later Viewing
Corey Schafer
49 Programming Terms: Combinations and Permutations
Programming Terms: Combinations and Permutations
Corey Schafer
50 Git Tutorial: Difference between "add -A", "add -u", "add .", and "add *"
Git Tutorial: Difference between "add -A", "add -u", "add .", and "add *"
Corey Schafer
51 Preparing for a Python Interview: 10 Things You Should Know
Preparing for a Python Interview: 10 Things You Should Know
Corey Schafer
52 SQL Tutorial for Beginners 1: Installing PostgreSQL and Creating Your First Database
SQL Tutorial for Beginners 1: Installing PostgreSQL and Creating Your First Database
Corey Schafer
53 SQL Tutorial for Beginners 2: Creating Your First Table
SQL Tutorial for Beginners 2: Creating Your First Table
Corey Schafer
54 SQL Tutorial for Beginners 3: INSERT - Adding Records to Your Database
SQL Tutorial for Beginners 3: INSERT - Adding Records to Your Database
Corey Schafer
55 Linux/Mac Terminal Tutorial: Navigating your Filesystem
Linux/Mac Terminal Tutorial: Navigating your Filesystem
Corey Schafer
56 Python: Ex Machina Easter Egg - Hidden Message within the Code
Python: Ex Machina Easter Egg - Hidden Message within the Code
Corey Schafer
57 Mac Tip: New Split Screen Feature in El Capitan
Mac Tip: New Split Screen Feature in El Capitan
Corey Schafer
Setting up a Python Development Environment in Eclipse
Setting up a Python Development Environment in Eclipse
Corey Schafer
59 Git Tutorial: Fixing Common Mistakes and Undoing Bad Commits
Git Tutorial: Fixing Common Mistakes and Undoing Bad Commits
Corey Schafer
60 SQL Tutorial for Beginners 4: SELECT - Retrieving Records from Your Database
SQL Tutorial for Beginners 4: SELECT - Retrieving Records from Your Database
Corey Schafer

This video teaches how to set up a Python development environment in Eclipse, including installation, configuration, and customization of the IDE for Python development. By following the steps outlined in the video, viewers can create a efficient and productive development environment for their Python projects.

Key Takeaways
  1. Download the Eclipse installer from the Eclipse website
  2. Run the Eclipse installer and update it if necessary
  3. Choose the Eclipse platform as the base for installing other tools
  4. Install the Java JVM and select the installation folder
  5. Select a workspace for storing projects and files
  6. Install the PyDev plugin for Python development in Eclipse
  7. Configure the Python interpreter for the project
  8. Create a new Python project in Eclipse using the PyDev plugin
  9. Configure project settings and create a new module within a package
  10. Use Eclipse's built-in template for new files
💡 The PyDev plugin provides a comprehensive set of tools for Python development in Eclipse, including syntax highlighting, code completion, and debugging capabilities.

Related Reads

Up next
How AI Is Transforming Analytics in Tableau Cloud & Server
Salesforce Product Center
Watch →