ImportError: No module named bs4 in Windows
Question: I am trying to create a script to download the captcha from my website. I
think the code works except from that error, when I run it in cmd (I am using
windows not Linux) I receive the following:

    
    
    from bs4 import BeautifulSoup
    ImportError: No module named bs4
    

I tried using `pip install BeautifulSoup4` but then I receive syntax error at
install.

Here is the script:

    
    
    from bs4 import BeautifulSoup
    import urllib2
    import urllib
    
    url = "https://example.com"
    content = urllib2.urlopen(url)
    soup = BeautifulSoup(content)
    img = soup.find('img',id ='imgCaptcha')
    print img
    urllib.urlretrieve(urlparse.urljoin(url, img['src']), 'captcha.bmp')
    

The problem according to this
[answer](http://stackoverflow.com/a/11784778/3065448) must be due to the fact
I have not activated the virtualenv, and THEN install BeautifulSoup4.

Also I don't think this information will be of any help but I save my python
text in a notepad.py and the run it using cmd.


Answer: I had the same problem until a moment ago. Thanks for the post and comments!
According to @Martin Vseticka 's suggestion I checked if I have the pip.exe
file in my python folders. I run python 2.7 and 3.7 simultaneously. I didn't
have it in the python 2.7 folder but in the 3.7. So in the command line I
changed the directory to where the pip.exe file was located. Then I ran "pip
install BeautifulSoup4" and it worked. See enclosed screen shot. [![enter
image description
here](http://i.stack.imgur.com/nFmDF.png)](http://i.stack.imgur.com/nFmDF.png)

