PyDev is a plugin that enables Eclipse to be used as a Python IDE (supporting also Jython and IronPython). It uses advanced type inference techniques which allow it to provide things such as code completion and code analysis, besides providing a debugger, interactive console, refactoring, tokens browser, django integration, etc. To wrap it up, PyDev is a lightweight, yet reliable Python IDE that comes as an Eclipse plugin and helps you simplify your work as a software developer by providing you with several functions.
- Download 'eclipse classic' from http://www.eclipse.org/downloads
- Unpack the tarball, which will be an 'eclipse' folder
- Move the 'eclipse' folder to /opt (for the long-term, not just in your downloads folder)
- Make an alias from the Eclipse app into /Applications
- Run eclipse
- Go to Help > Software Updates > Available Software and click 'Add Site...'
enter: http://pydev.sourceforge.net/updates/ - Check the new site, including 'PyDev for Eclipse' among its children
- Click the 'Install...' button, and go through all the prompts including restarting eclipse
- Open Eclipse > Preferences > PyDev > Interpreter - Python
- Click the 'New...' button
- Navigate in the finder open dialog to select /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
(tip: Use Cmd-Shift-G and paste in the directory, then select python2.5) - Leave the default checked items for PYTHONPATH and click OK (you can edit it later if you need to)
If you're doing an AppEngine app, you can add this to your PYTHONPATH:
/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine
Hi,
today, I was suffering to run simple python script that connect to local postgresql database. I’m trying to use eclipse pydev plugin to develop my python scripts. there is very simple trick that solve the problem. I wanted to write it here , so may be someone will read it one day and save time.
my OS is: OSX Yosemite version 10.10.2 and i’m using Postgresql version 9.5.1.
first step is that you need to install “psycop2” the python driver to Postgresql database. in Mac OSX , you can do it by typing the following command line:
sudo pip install psycopg2
then you need to go to eclipse and create a new python project and type the following simple script which try to connect to database.
import psycopg2
try:
conn = psycopg2.connect(“dbname=’myDB’ user=’postgres‘ host=’localhost‘ password=””)
print ‘connected’
except:
Eclipse Plus Pydev
print “I am unable to connect to the database”
when you try to run/debug the code in eclipse , you will get an error as shown in the following screenshoot.
the solution is here is very simple. in the pydev configuration in Eclipse you need to add a new environment variable “
DYLD_FALLBACK_LIBRARY_PATH
” and put set it to the Postgresql installation Lib path. in my case the installation Lib folder was in “/Applications/Postgres.app/Contents/Versions/latest/lib” and then I create the environment variable and set it to “/Applications/Postgres.app/Contents/Versions/latest/lib:$DYLD_LIBRARY_PATH” . you can see that as shown in the following screenshoot:
Install Pydev In Eclipse
once you are doing that and run the code again , the code will run successfully.