Starting with Python On Eclipse in Ubuntu 10 comments


Eclipse is a universal toolset for development and is used in many of the companies for software development . Originally created back in November 2001 by IBM Eclipse supports development in many languages one of which is but not limited to Python. For this purpose Eclipse uses plugins that extends its functionality and makes it much more usable for that particular language.One such plugin is pydev which is makes Eclipse more like IDE for Python Development

PYTHON INSTALLATION

Though Python will be already installed on Ubuntu but just to make things perfect

sudo apt-get install python

INSTALLING ECLIPSE

Eclipse is available in Ubuntu Software Center under the Development Tools category or you can visit Eclipse’s website to download it and install

NOTE : Eclipse required Java to be installed , if you are not using the Ubuntu Software Center to install Eclipse do make sure that Java is installed

sudo apt-get install eclipse sun-java6-jdk
sudo update-java-alternatives -s java-6-sun

INSTALLING PYDEV

Before starting up with a new python project lets make Eclipse more suitable for Python Development

  1. Select Help-> Install New Software from the Eclipse menu
  2. Click on  Add  to add new resource from where Python Plug-in will get installed in eclipse
    • NAME : PydevEnv (or anything you like)
    • URL :  http://pydev.org/updates
  3. In Works With field and select the PydevEvnv resource we just added
  4. Select the Pydev from a list of check box will be available ( There will be one PyDev and other PyDev MyLyn Integration) and click next
  5. Wait for the download to finish and agree with the License terms as required
  6. Restart Eclipse

CONFIGURING PYDEV FOR PYTHON DEVELOPMENT

  1. To configure PyDev for Python development go to Window>Preferences>PyDev >Editor >Interpreter Python
  2. You can either click Auto C0nfig and let the Eclipse do the part or you can yourself set the config to locate the Python Files (generally /usr/bin/python )
  3. Click OK to Finish our last part of configuration
  4. You are now ready to start Development on Eclipse

STARTING A NEW PROJECT

  1. Click on File > New>Project and select Pydev project
  2. Click File >New >File and name it as Hello World.py
  3. Add few lines of you Python code and save the file
  4. Click on Run or press Ctrl + F11

Note : Please refer screenshots for more

Enjoyy Coding with Python…!!!

 


About Gaurav Saini

Geekier Than You....!!! A PC Addict Who Believes In Winning n Practicality. Free Tech Consultant | Blogger | Entrepreneur | FOSS Newbie | Critic | Visionary | Loading...

  • Matheuspatury

    Thank You! I liked it +1

  • Llorenem

    CheersMate

  • Anhdungvns

    thank you ! very useful for me !
     

  • Escape2728

    It is really a useful post to a newbie………….Thanks…..

  • Ast

    I wanted to thank you as well. Saved my time! 🙂

  • Kapil

    Thanks .. it worked out for me!!!!

  • Jojo

    Thank you. very neatly explaines

  • neomie

    great stuff! thanks

  • Newbie

    Wow! That was amazing!!
    Thanks!!

  • Yug

    if you didn’t found pydev in Preferences then your version in wrong ,uninstall and reinstall your pydev version:
    Eclipse 4.5, Java 8: PyDev 5.2.0
    Eclipse 3.8, Java 7: PyDev 4.5.5
    Eclipse 3.x, Java 6: PyDev 2.8.2
    Python 2.5 or older: PyDev 5.5.0
    Browse other versions of pydev note:(open in browser to select URL for Eclipse):
    http://www.pydev.org/update_sites

    To configure PyDev for Python development go to Window>Preferences>PyDev >Editor >Interpreter Python
    For me path was : Window>Preferences>PyDev > Interpretor >python interpretor