note that I am coding in Python and using VScode as my editor.
I have imported the Scapy module for my code the following way:
from scapy.all import *
.
The problem is that some of the functions that that are imported are marked as undefined.
Error description popup that is displayed when hovering over a marked imported function
My question is, how can I make VScode recognize these functions?
So far, it only occurred for the functions from the layers class of Scapy (scapy.layers
), but do bare in mind that other than these functions I am using only the srp1
function, which is from another class.
The code does run perfectly when ran through VScode's terminal, so I have figured the problem must be related to the Python's IntelliSense that I am using.
I have checked that the selected Python interpreter in VScode is the same one as the one that its path is saved and used in the PATH environmental variable.
I have also tried importing directly from the layers class (from scapy.layers.all import *
) but it also didn't seem to help.
Something that did work for me is replacing the *
with the names of the functions that cause this problem, but I find this solution to be more messy and also impractical because there are quite a few function that should be listed there, and there would probably be more to add in the future.