PyCharm 外部模块导入提示 unresolved reference
解决方法是把文件夹设置为根目录。
1.在项目上单击右键 -> Mark Directory as -> Sources Root
2.再次点击,红色警告消失
3.进入设置:file -> settings
4.展开 Build,Execution,Deployment -> Console -> Python Console -> Add source roots to PYTHONPATH,勾选上Add source roots to PYTHONPATH,选择确定,问题完美解决