BeautifulSoup4 cannot be installed in python3.5 on Windows7

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 BeautifulSoupdoesn'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

+3
2

BeautifulSoup4 Python 3x 2x, . - Python 3x.

http://www.crummy.com/software/BeautifulSoup/#Download https://pypi.python.org/pypi/beautifulsoup4/4.3.2 beautifulsoup4-4.3.2.tar.gz.

, . 7zip beautifulsoup4-4.3.2.tar.gz.

beautifulsoup4-4.3.2.tar.gz, dist, beautifulsoup4-4.3.2.tar.

beautifulsoup4-4.3.2.tar, beautifulsoup4-4.3.2. beautifulsoup4-4.3.2 setup.py.

Shift, .

: setup.py install Enter.

, , , C:\Python34\Lib\site-packages. , bs4.

, , > > Python 3.4 > IDLE (32- Python 3.4), IDE.

: → > bs4 import BeautifulSoup

, .

+1

:

, beautifulsoup, python, all , beautifulsoup, C:\Users\yourname\AppData\Local\Programs\Python\Python35-32\Lib\-

, pip uninstall beautifulsoup4, pip install beautifulsoup4 D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3 cmd, , setup.py.

-, setup.py IDLE

, from bs4 import BeautifulSoup IDLE. .

0

Source: https://habr.com/ru/post/1017065/


All Articles