Форум сайта python.su
IDLE (Python 3.8 32-bit) Windows 7
index.html — лежит в папке со скриптом.
————-
Запускаю этот скрипт:
from bs4 import BeautifulSoup import re def main(): html = open('index.html').read() print(html) if __name__ == '__main__': main()
[code python]Traceback (most recent call last):
File "C:\Users\Александр\Desktop\6\main.py", line 2, in <module>
from bs4 import BeautifulSoup
File "C:\Python38-32\lib\site-packages\bs4\__init__.py", line 32, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "C:\Python38-32\lib\site-packages\bs4\builder\__init__.py", line 515, in <module>
from . import _lxml
File "C:\Python38-32\lib\site-packages\bs4\builder\_lxml.py", line 16, in <module>
from lxml import etree
File "src\lxml\etree.pyx", line 1, in init lxml.etree
ValueError: builtins.type size changed, may indicate binary incompatibility. Expected 440 from C header, got 432 from PyObject[/code]
Офлайн
попробуйте удалить через pip uninstall, потом обратно установить,
Офлайн
Уважаемый xam1816 спасибо.
Всё сделал как Вы сказали.
Опять ошибка:
Traceback (most recent call last): File "C:\Users\Александр\Desktop\6\main.py", line 2, in <module> from bs4 import BeautifulSoup File "C:\Python38-32\lib\site-packages\bs4\__init__.py", line 32, in <module> from .builder import builder_registry, ParserRejectedMarkup File "C:\Python38-32\lib\site-packages\bs4\builder\__init__.py", line 515, in <module> from . import _lxml File "C:\Python38-32\lib\site-packages\bs4\builder\_lxml.py", line 16, in <module> from lxml import etree File "src\lxml\etree.pyx", line 1, in init lxml.etree ValueError: builtins.type size changed, may indicate binary incompatibility. Expected 440 from C header, got 432 from PyObject
Офлайн
satfanВыложите полный код
Опять ошибка:
Офлайн
Python 3.8.0a1 (tags/v3.8.0a1:e75eeb00b5, Feb 3 2019, 19:46:54) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> =============== RESTART: C:\Users\Александр\Desktop\6\main.py =============== Traceback (most recent call last): File "C:\Users\Александр\Desktop\6\main.py", line 2, in <module> from bs4 import BeautifulSoup File "C:\Python38-32\lib\site-packages\bs4\__init__.py", line 32, in <module> from .builder import builder_registry, ParserRejectedMarkup File "C:\Python38-32\lib\site-packages\bs4\builder\__init__.py", line 515, in <module> from . import _lxml File "C:\Python38-32\lib\site-packages\bs4\builder\_lxml.py", line 16, in <module> from lxml import etree File "src\lxml\etree.pyx", line 1, in init lxml.etree ValueError: builtins.type size changed, may indicate binary incompatibility. Expected 440 from C header, got 432 from PyObject >>>
Офлайн
может вам еще вот это скачать
pip install lxml
Офлайн