记录下使用vs code跑python遇到的坑
1、装了很多个python sdk。致命的是在环境变量了还配了多个python的PATH,导致pip install 好好的,可跑起程序来却老找不到包。
- 对于新手,删除多余的python版本,就留最新的3.7的。
- 使用pip3 install来装包。
- 将环境变量里的python PATH清理一下,最后只留一个。
2、vs code没有配置解释器(Interpreter)
- 在vs code安装完python插件后,ctrl+shift+p,然后选择
Python: Select Interpreter
(如果出现“no Interpreter found”,最后重启一下),选择一个你安装的python路径。
3、一些莫名其妙的错误
- RequestsDependencyWarning: urllib3 (1.25.6) or chardet (3.0.4) doesn't match a supported version!解决方法在这。
pip3 uninstall urllib3
pip3 uninstall chardet
pip3 install --upgrade requests
4、'chromedriver' executable needs to be in PATH
- 参考这篇解决。
后记,不想弄vs code,debug搞不定,还是用PyCharm吧。
网友评论