If I understand the indentation correctly, would not this message be printed (and exit(1) issued in the following line) even if BeautifulSoup was imported without problems?