在cmd下python模块可以import,而PyCharm仍然报错:ModuleNotFoundError:
这种情况一般是pycharm没有识别到python的路径
在PyCharm中File->Settings->Project Interpreter 菜单,可以看到已安装了哪些文件库
下拉框,选择本地安装python环境的目录

此时就能看到安装的python模块,切换完成后,点击apply,然后重启pycharm

就能成功import
 
参考文档;https://blog.csdn.net/qq_41144863/article/details/98064865
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号