Problem in stalling packages
I have installed a number of packages and have successfully be using them.
For some reason beautifulsoup4 is not recognised when I try use it, I 'import bs4' into a py file and the module is not recongised, but I have installed the package through the project interpreter.
I'm running PyCharm on a windows environment and using python 3.4.4.
Can someone help?
请先登录再写评论。
I just gave it a try and it worked fine. Is your issue only that the code isn't "recognized", or does it also fail during execution?
On the first line when I type in 'import bs4', and thats fine.
But when I go to use bs4() in my code, the 'bs4' on the first line has a red zigzaged line underneath, which suggests no module named bs4 is found. I also tried variations (beautifulsoup4 and beautifulsoup). I even tired to run the code, but an ImportError arises, 'ImportError: No Module named 'bs4'. Below is the code:
You have "from b4s" instead of "bs4".
Hi Paul,
As you can probably tell, I'm a novice. Only been programming for a couple of months.
I made the following changes, but I now get a different error message. Can you please advise on what I should do?
I'm not much of a beautifulsoup user, but a bit of googling showed that you just need to do what it suggests. That is, change your line:
...to:
...to explicitly name which parser you want to use.
Thanks Paul!
That has done the trick.