When using PyCharm, you must encounter a large number of red wavy lines because the Python interpreter cannot find the packages and files.
The solution is as follows: 1. Go to Settings of PyCharm and go to Python Console
2. Select Add Source Roots to PYTHONPATH in the image above and click ok to confirm. 3, go to the Root Directory of the project: right-click the Root Directory, go to Mark Directory as – > Source Root
4. The red wavy lines in the code disappear after pressing CTRL +S
Summary: The red wavy line appears because the local path is not marked as “source directory”