I know this question has been asked a lot on this site, but I have tried all of the solutions given, and I cannot figure out how to solve this problem.
For starters: I am on a Windows 10
computer using Python 3.6
. I installed Anaconda
as my IDE.
I tried to install BeautifulSoup4
with pip
install beautifulsoup4
, but I got the
Requirement already satisfied
response.
The code I am trying to run is just
from bs4 import BeautifulSoup4
to which I get the error: ImportError: cannot import name 'BeautifulSoup4'
The full error is:
runfile('C:/Users/ter/.spyder-py3/untitled1.py', wdir='C:/Users/ter/.spyder-py3')
Traceback (most recent call last):
File "<ipython-input-21-8717178e85e1>", line 1, in <module>
runfile('C:/Users/ter/.spyder-py3/untitled1.py', wdir='C:/Users/ter/.spyder-py3')
File "C:\Users\ter\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "C:\Users\ter\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/ter/.spyder-py3/untitled1.py", line 8, in <module>
from bs4 import BeautifulSoup4
ImportError: cannot import name 'BeautifulSoup4'
Here is what I have tried to resolve this problem:
- 1. Since 90% of the solutions I have found were because someone had named a file `bs4.py`, I checked for that. However this was the very first file I had made on this computer which was just named `untitled1.py`. Later on (last thing I did) out of frustration I deleted every instance of bs4 and beautiful from my computer, and the problem persisted, so another file being named `bs4` is definitely not the issue.
- I tried just importing
bs4
(importbs4
). That works perfectly fine, or at least it does not lead to any errors. - I changed the directories around. The
bs4
file is currently in the defaultAnaconda
folder. I then changed the CD to the location of the project file and even tried copying and pasting thebs4
,bs4-0.0.1.dist-info
, andbeautifulsoup4-4.6.3.dist-info
files into the project file directory. Nothing really changed there. - I also did
pip3
installbs4
. I don't know if that's necessary, but I did that as well. - I reinstalled all of these multiple times including
Anaconda
once andbs4/beautifulsoup
7 or 8 times, including a few uses ofpip install --upgrade -force-reinstall beautifulsoup4
.
Anyways, I hope this helps describe the problem. Let me know if I can provide any further information.
Thanks in advance for any help you guys can give me!