I downloaded beautifulsoup4-4.5.3.tar.gz from https://www.crummy.com/software/BeautifulSoup/bs4/download/4.5/ and unzipped it in my python working directory (which is not my python installation directory).
However, when I run
from bs4 import BeautifulSoup
I got an error message in my IDLE:
>>> from bs4 import BeautifulSoup
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
from bs4 import BeautifulSoup
File "D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3\bs4\__init__.py",
line 53
'You are trying to run the Python 2 version of Beautiful Soup under Python
3. This will not work.'<>'You need to convert the code, either by installing
it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).'
^
SyntaxError: invalid syntax
I tried these methods, but the above massage errors did not come out
- open setup.py in my IDLE and run it (gives
=== RESTART: D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3\setup.py ===
in IDLE windows but from bs4 import BeautifulSoup
doesn't work) - cmd D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3,
pip uninstall beautifulsoup4
, pip install beautifulsoup4
, , beautifulsoup4-4.5.3 cmd, , error IDLE from bs4 import BeautifulSoup
- cmd
D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3,
pip3
uninstall beautifulsoup4
, pip3 install beautifulsoup4
;
, pip install bs4 --ignore-installed
, ,setup.py install
, ,2to3 -w bs4
cmd D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3, '2to3' is not recognized as an internal or external command,operable program or batch file.
?
, pip show bs4
`Metadata-Version: 1.1
Name: bs4
Version: 0.0.1
Summary: Screen-scraping library
Home-page: https://pypi.python.org/pypi/beautifulsoup4
Author: Leonard Richardson
Author-email: leonardr@segfault.org
License: MIT
Location: c:\users\myname\appdata\local\programs\python\python35-
32\lib\site-packages
Requires: beautifulsoup4
You are using pip version 7.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.`
C:\Users\myname\AppData\Local\Programs\Python\Python35-32\Lib\site-packages, , beautifulsoup: beautifulsoup4-4.5.3.dist-info, bs4 bs4-0.0.1-py3.5.egg-info, from bs4 import BeautifulSoup