How to Solve NameError: name 'platform' is not defined -- sys

Solution: Import the 'platform' module

To Solve the error, add the following line to the top of your code.

from sys import platform

 

For more information:
Python sys platform