Error importing BeautifulSoup - Conflict with Python version

不问归期 提交于 2019-12-01 14:44:43

It should be,

from bs4 import BeautifulSoup

Do this:

  • easy_install pip
  • When that is done, restart, and type in pip install beautifulsoup4. That should work.

Make sure that you have it as a module with pip list, if you see Beautiful Soup as an output, then yes, you have it working.

After some research I discovered that this solve the issue:

pip uninstall BeautifulSoup4

will uninstall the package that is in:

/Library/Python/2.6/site-packages/

And:

easy_install-2.7 BeautifulSoup4

will successfully install the package in:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

I've checked the process also with some other packages having the same issues and it works.

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