Ask Your Question

Revision history [back]

I fixed by cleaning my python2.7.5 installation and reinstalling opencv from homebrew, as well.

In eclipse's Pydev preferences, I removed the executable and put it back.

The actual key step was about making sure that the System PYTHONPATH (in Pydev's bottom window) has the library path where the opencv library (the cv2.so file) is in your system, such as /usr/local/lib/python2.7/site-packages

Pydev now autocompletes my cv2 methods as desired.

I fixed it by cleaning my python2.7.5 installation installation/configuration (in general) and reinstalling opencv from homebrew, as well.well. I prefer that whatever is installed by PIP is only getting put in the /usr/local/lib/python2.7/site-packages (this is accomplished by setting your PYTHONPATH env. variable to be only that)

In eclipse's Pydev preferences, I removed the executable and put it back.back, eg. /usr/local/bin/python

The actual key step was about making sure that the System PYTHONPATH (in Pydev's bottom window) has the library path where the opencv library (the cv2.so file) is in your system, such as /usr/local/lib/python2.7/site-packages

Pydev now autocompletes my cv2 methods as desired.

click to hide/show revision 3
Better / cleaner answer

Set the important Interpreter's System PYTHONPATH (Libraries)

I fixed it by cleaning my python2.7.5 installation/configuration (in general) and reinstalling opencv from homebrew, as well. I prefer that whatever is installed by PIP is only getting put Don't forget to add Python's Lib path, such as:

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7

in addition to the /usr/local/lib/python2.7/site-packages (this is accomplished by setting your PYTHONPATH env. variable to usual site-packages

/usr/local/lib/python2.7/site-packages

Nothing else really should be only that)needed in PyDev

In eclipse's Pydev preferences, I removed the executable and put it back, eg. Pydev /usr/local/bin/python

The actual key step was about making sure that the System PYTHONPATH (in Pydev's bottom window) has the library path where the opencv library (the cv2.so file) is in your system, such as /usr/local/lib/python2.7/site-packages

Pydev now autocompletes auto-completes my cv2 methods as desired.

click to hide/show revision 4
Corrected the fact unpackaged modules should also be added

Set the important Interpreter's System PYTHONPATH (Libraries)

Don't forget to add Python's Lib path, such as:

/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7

in addition to the usual site-packages

/usr/local/lib/python2.7/site-packages

Finally, add other paths for modules that only live inside eggs or that haven't been packaged (exist inside folders that don't have an __init__.py)

Nothing else really should be needed in PyDev

Pydev now auto-completes my cv2 methods as desired.desired :)