anaconda 3 problem

19 views
Skip to first unread message

Disuqi Hijazi

unread,
Jun 1, 2021, 10:03:41 AMJun 1
to Anaconda - Public
Hello,
I have a very simple code and I am getting a really weird error I cant find anything on google.

import requests
from bs4 import BeautifulSoup

soup = BeautifulSoup(page.content, 'html.parser')

print(soup)

this is the error, I have no idea what to do
C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\element.py:15: UserWarning: The soupsieve package is not installed. CSS selectors cannot be used.
  warnings.warn(
Traceback (most recent call last):
  File "d:/Programming/Python/Other things/datetime.py", line 1, in <module>
    import requests
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\requests\__init__.py", line 43, in <module>
    import urllib3
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\__init__.py", line 11, in <module> 
    from . import exceptions
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\exceptions.py", line 3, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 199, in load_module
    mod = mod._resolve()
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve
    return _import_module(self.mod)
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
    __import__(name)
  File "C:\Users\Disuqi\anaconda3\lib\http\client.py", line 71, in <module>
    import email.parser
  File "C:\Users\Disuqi\anaconda3\lib\email\parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "C:\Users\Disuqi\anaconda3\lib\email\feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "C:\Users\Disuqi\anaconda3\lib\email\_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
  File "C:\Users\Disuqi\anaconda3\lib\email\utils.py", line 30, in <module>
    import datetime
  File "d:\Programming\Python\Other things\datetime.py", line 2, in <module>
    from bs4 import BeautifulSoup
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\__init__.py", line 32, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\builder\_html5lib.py", line 20, in <module>
    import html5lib
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\html5lib\__init__.py", line 28, in <module>
    from .serializer import serialize
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\html5lib\serializer.py", line 11, in <module>
    from xml.sax.saxutils import escape
  File "C:\Users\Disuqi\anaconda3\lib\xml\sax\saxutils.py", line 6, in <module>
    import os, urllib.parse, urllib.request
  File "C:\Users\Disuqi\anaconda3\lib\urllib\request.py", line 1387, in <module>
    if hasattr(http.client, 'HTTPSConnection'):
AttributeError: module 'http' has no attribute 'client'
PS D:\Programming> conda activate
PS D:\Programming> & C:/Users/Disuqi/anaconda3/python.exe "d:/Programming/Python/Other things/datetime.py"
C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\element.py:15: UserWarning: The soupsieve package is not installed. CSS selectors cannot be used.
  warnings.warn(
Traceback (most recent call last):
  File "d:/Programming/Python/Other things/datetime.py", line 1, in <module>
    import requests
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\requests\__init__.py", line 43, in <module>
    import urllib3
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\__init__.py", line 11, in <module>
    from . import exceptions
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\exceptions.py", line 3, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 199, in load_module
    mod = mod._resolve()
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve
    return _import_module(self.mod)
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
    __import__(name)
  File "C:\Users\Disuqi\anaconda3\lib\http\client.py", line 71, in <module>
    import email.parser
  File "C:\Users\Disuqi\anaconda3\lib\email\parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "C:\Users\Disuqi\anaconda3\lib\email\feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "C:\Users\Disuqi\anaconda3\lib\email\_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
  File "C:\Users\Disuqi\anaconda3\lib\email\utils.py", line 30, in <module>
    import datetime
  File "d:\Programming\Python\Other things\datetime.py", line 2, in <module>
    from bs4 import BeautifulSoup
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\__init__.py", line 32, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
PS D:\Programming\Python\Other things> py datetime.py
C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\element.py:15: UserWarning: The soupsieve package is not installed. CSS selectors cannot be used.
  warnings.warn(
Traceback (most recent call last):
  File "datetime.py", line 1, in <module>
    import requests
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\requests\__init__.py", line 43, in <module>
    import urllib3
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\__init__.py", line 11, in <module> 
    from . import exceptions
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\exceptions.py", line 3, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead       
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 199, in load_module
    mod = mod._resolve()
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve
    return _import_module(self.mod)
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
    __import__(name)
  File "C:\Users\Disuqi\anaconda3\lib\http\client.py", line 71, in <module>
    import email.parser
  File "C:\Users\Disuqi\anaconda3\lib\email\parser.py", line 12, in <module>
    from email.feedparser import FeedParser, BytesFeedParser
  File "C:\Users\Disuqi\anaconda3\lib\email\feedparser.py", line 27, in <module>
    from email._policybase import compat32
  File "C:\Users\Disuqi\anaconda3\lib\email\_policybase.py", line 9, in <module>
    from email.utils import _has_surrogates
  File "C:\Users\Disuqi\anaconda3\lib\email\utils.py", line 30, in <module>
    import datetime
  File "D:\Programming\Python\Other things\datetime.py", line 2, in <module>
    from bs4 import BeautifulSoup
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\__init__.py", line 32, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\builder\__init__.py", line 509, in <module>
    from . import _html5lib
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\bs4\builder\_html5lib.py", line 20, in <module>
    import html5lib
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\html5lib\__init__.py", line 28, in <module>
    from .serializer import serialize
  File "C:\Users\Disuqi\anaconda3\lib\site-packages\html5lib\serializer.py", line 11, in <module>
    from xml.sax.saxutils import escape
  File "C:\Users\Disuqi\anaconda3\lib\xml\sax\saxutils.py", line 6, in <module>
    import os, urllib.parse, urllib.request
  File "C:\Users\Disuqi\anaconda3\lib\urllib\request.py", line 1387, in <module>
    if hasattr(http.client, 'HTTPSConnection'):
AttributeError: module 'http' has no attribute 'client'

PLEASE HELP
Reply all
Reply to author
Forward
0 new messages