Whenever I type Import Serial the import statement just turns grey and does nothing. I have installed Py-Serial using pip install pyserial and it said it was successful but for some reason I cant import it. Any help would be appreciated.
-
1I'm assuming its turned gray because of your IDE?A random coder– A random coder2021-04-16 20:26:23 +00:00Commented Apr 16, 2021 at 20:26
-
2What editor are you using? Many editors will show gray import statements if they are not used. Import statements by themselves don't really do much. You need to actually use the import in later code.Code-Apprentice– Code-Apprentice2021-04-16 20:26:26 +00:00Commented Apr 16, 2021 at 20:26
Add a comment
|
1 Answer
Whenever I type Import Serial the import statement just turns grey and does nothing.
An import statement by itself doesn't do anything*. Many editors will show gray import statements if they are not used. You need to add code that uses the imported module such as serial.some_function().
*Oversimplified for the current context.