Import error aftert adding site.py file to project

℡╲_俬逩灬. 提交于 2019-12-11 04:12:56

问题


After I've added site.py to top directory of my project, my application started to fail with an exception: "ImportError: No module named 'bs4'".

Before adding this file, application worked file. BeautifulSoup4 package is installed in used interpreter.

What's happening here?


回答1:


site.py shadows built-in site module.

Due to wrong site.py module being imported, paths used to search for user-installed packages are never set, therefore interpreter is unable to find bs4 module.



来源:https://stackoverflow.com/questions/41125919/import-error-aftert-adding-site-py-file-to-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!