anaconda opencv in eclipse pydev unresolved import - eclipse

I cannot find the answer to this, and I have looked quite a bit. I used the python distribution, anaconda, to install opencv for use in my python applications using the instructions on this web site,
https://rivercitylabs.org/up-and-running-with-opencv3-and-python-3-anaconda-edition/
It is very easy, it works great, and opencv is available in my python applications. I have only one problem, and it is in the nature of an annoyance: eclipse and pydev cannot see that cv2 is available, and they give the little red underline on the import cv2 statement, and claim this is an "unresolved import". I repeat, cv2 works when I run my python applications, no problem. It is just not being seen by eclipse and pydev.
I looked in the anaconda env directory where opencv is installed, and found in the lib/python3.6/site-packages directory this file:
cv2.cpython-36m-x86_64-linux-gnu.so
This folder, /anaconda-env-folder/lib/python3.6/site-packages, is of course listed on the python path for the anaconda virtual env in eclipse. Nothing would work without it. But everything else in this folder is a py file. This one is an so. Is that the problem? Eclipse and pydev cannot see this type of file, and therefore cannot give it credit for being importable? Even though python can import it?
I tried adding the directory as an external library, and I tried starting eclipse with this directory in the LD_LIBRARY_PATH, as per:
Eclipse with $LD_LIBRARY_PATH
It is still an "unresolved import".
Is there a way to fix this?
Thanks for any help!

Take a look at my answer, especially at Eclipse tutorial image.
Installing opencv on Windows 10 with python 3.6 and anaconda 3.6
Even if Windows 10, it should work also on Linux...
Also, try use cv2.cv2 syntax and see what happens..

Related

IDE autocomplete for pytorch

I'm using Visual Studio Code. Recently tried out Kite. Both of which doesn't seem to have autocomplete for pytorch.
Is is possible with these tools ? If not, can someone suggest an editor that does ?
Thank you!
Use Pycharm https://www.jetbrains.com/pycharm/
Get Community version, because it is free with debugger and autocomplete. (more than enough for student)
To get autocomplete and run/debug the code on Pycharm IDE, you have to set correct project interpreter path to your environment (or virtual environment) which you install pytorch
The screenshot shows that I set Project Interpreter path to conda environment named 'pytorch', which I install Pytorch.
Spyder does autocomplete for PyTorch as well
Both Spyder and PyCharm have auto-complete feature for the installed libraries. But this feature does not seem to work for the local project files (functions, classes, variables defined in the local files even if they are imported).
They also have "go to definition" and "help", but again, only for the installed libraries.
I hope these features will be included soon, in addition to "references to this variable/function/class", which is available in advanced IDEs and is quite useful.

Eclipse does not start after download - Ubuntu

I had recently downloaded the Eclipse Platform SR2 Kepler edition from the eclipse foundation website. However after unpacking the tarball I tried to open it by simply double clicking on the "eclipse" file. But it does not start. What could be the problem ?
Please help.
There are many possible reasons:
missing libraries or version mismatch
64/32bit mismatch
bad permissions
lack of disk space
no memory
left directories from a previous installation
For first, try to run it in a terminal and watch the output.
There are also a pre-defined packages from ubuntu. The main package is called just 'eclipse'. Normally, you can assume they work out of the box.

ArUco in Eclipse Ubuntu

I want to compile the augmented reality ArUco library, but this library documentation on the internet is too scarce and I am facing some problems. Could someone give me a little tutorial about how to compile it in the Eclipse? (could be another IDE)
I'm using the Ubuntu 12.10, Eclipse Juno. Thanks!
Look at the README file of the library, you will probably have to use cmake. Open a terminal and install cmake and OpenCv (the requirements for the library) with apt-get. I don't know their exact package names in Ubuntu, but try the obvious cmake and opencv. Once that is done, cd to the directory where you unpackaged the aruco library, and do the following:
mkdir build && cd build
cmake ..
make all
make install
You can change the installation prefix by using cmake -i .. or ccmake if it got installed too. As for setting up the library in your IDE, just make a note of which directories the library files (binaries and headers) got installed to, and make sure those are in the compiler's search path.

Pydev missing after upgrading Eclipse on FreeBSD

I recently updated my ports on my FreeBSD 9.0 release machine and I think eclipse was upgraded due to a port upstream forced Eclipse to be rebuilt. Now Pydev is gone. I tried uninstalling then reinstalling Eclipse, then installing Pydev using pydev.org/updates inside Eclipse. It appears to install ok but I can't create a Pydev project or use the Pydev view. I tried removing my ~/.eclipse folder to force the creation of a new one, and reinstalling Eclipse and Pydev to no avail. What am I doing wrong? I'm running Eclipse Indigo version 3.7.1 build id: R3_7_1
This question was most similar to mine, but the solution didn't work for me. I also tried pointing my install site as: http://update-production-pydev.s3.amazonaws.com/pydev/updates/site.xml per another question on StackOverflow, to no avail.
After some more testing I finally got the newest FreeBSD port to work. I had to launch and install the plugins as root. It didn't work another time I ran it but, this great troubleshooting document helped out. I methodically went through each step one by one, and the logs indicated there was an error on my /usr/local/lib file it was trying to unzip. My user doesn't have write access to that directory but root does. I don't know why it didn't work the last time I ran it as root, perhaps I didn't install the plug-in as root. It works now, so I'm happy. Thanks Fabio, for your input.
I'm not sure how FreeBSD packages things, so, maybe an easy way out would be getting Eclipse from Eclipse.org and installing PyDev on that fresh install (or if you're also doing web stuff, I'd suggest grabbing Aptana Studio 3, which comes with PyDev preinstalled, so, you don't have to worry about configuring it).
See: http://pydev.org/download.html for details

In Netbeans 6.8 cant find org.netbeans package

I have netbeans 6.8 with java ME platform setup on my ubuntu 9.10.
My code requires the package org.netbeans.microedition.lcdui which is either not installed or not in the path.
Surprising this runs perfectly in netbeans 6.8 on windows on my friend's pc.
Is there any java ME plugin I need to install?
Can somebody help me out with this?
Thanks in advance.
Sounds like netbeans_midp_components_basic.jar is missing from your NB install for some reason.
Try get netbeans_midp_components_basic.jar off your friend's PC (under [NetBeansRoot]/mobility8/modules/ext) and put it in your own install in the same path. Or add it to your project's build path.
If the file netbeans_midp_components_basic.jar is missing, some others might be missing too which will cause problems down the line. So a better way I'd suggest a reinstall, double checking that you get the NB6.8 that's bundled with the mobility pack.