I recently bought a Jetson Nano developer kit and downloaded the latest SD card image, r32.3.1. Created the SD card, booted the nano, installed the code-OSS (free version of Microsoft’s Visual Studio IDE) to develop Python programs. (I am following along a Youtube series “AI on the Jetson Nano” found at www.toptechboy.com.) The version of openCV on the SD card is 4.1.1. All is working okay as far as entering and running Python programs, but I do notice that I do NOT get “code completion” help when entering a statement. For example, watching the Youtube videos, when the presenter types
frame=cv2.rectangle()
it results in a popup showing the parameters for rectangle, and when the presenter types
fnt=cv2.FONT
(and pressing Ctrl-space maybe; this is what I do in the Eclipse IDE on my regular PC when developing Java programs) results in a popup showing a list of fonts.
However, on my nano, when I type the same thing (within the IDE of course), I do not get the “code completion” hints. I do get the hints when entering statements that do not refer to cv2 items (such as “np.” and pressing Ctrl-space does produce suggestions). Doing some research, I found what I think is why. Run the following simple Python program. From a terminal window or within the IDE.
******** Begin program ********
import cv2
print(cv2.version)
print(cv2.file)
******** End program ********
The output I see on my Jetson Nano is
4.1.1
/usr/lib/python3.6/dist-packages/cv2/python-3.6/cv2.cpython-36m-aarch64-linux-gnu.so
There should be a file ending with “.py” and/or “.pyc”. The “.py” one contains source that (I think) the code-OSS IDE needs to produce the code completions. As shown by the output for my system, I do not have such a file, hence no code completions. If I do the same thing, but do “import numpy as np” as the first line and “print(np.file)” as the third line I see
/usr/lib/python3/dist-packages/numpy/init.py
Doing a “ls” on the numpy subdirectory shows several “.py” files that are numpy related. Doing a “ls” on the above cv2 subdirectory shows a few “.py” files, none of which is cv2 related; the python-3.6 subdirectory only contains the “.so” file. This explains to me why I see code completion hints for non-cv2 items but do not see hints for cv2 items.
In summary, it appears that the current SD card image does not contain any cv2 related Python source files. This explains (to me) why there are no cv2 related code completion hints shown in the IDE.
The “toptechboy” presenter is using an earlier version of the SD card. He did have to go through some contortions (watch video 10 where he installed opencv) to get opencv installed. His version is 3.3.1. Apparently, the Python source is present, so he does see code completion hints.
Is there something I can do to get the hints with my SD card? Having the code completion hints would be a great help for a developer.
I am a newbie to the Jetson Nano, so I could be missing something simple.