S
S
Sergey Karbivnichy2015-12-14 22:12:41
Python
Sergey Karbivnichy, 2015-12-14 22:12:41

The program in python does not work, what are the errors?

Here is the simplest program using urllib:

import urllib.request

site = urllib.request.urlopen("http://ex.ua")
page = site.read()
print(page)

But instead of the page code, I see a bunch of errors:
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "/home/guest/workspace/test/main.py", line 1, in <module>
    import urllib.request
  File "/usr/lib/python3.2/urllib/request.py", line 88, in <module>
    import http.client
  File "/usr/lib/python3.2/http/client.py", line 69, in <module>
    import email.parser
  File "/usr/lib/python3.2/email/parser.py", line 12, in <module>
    from email.feedparser import FeedParser
  File "/usr/lib/python3.2/email/feedparser.py", line 27, in <module>
    from email import message
  File "/usr/lib/python3.2/email/message.py", line 17, in <module>
    from email import utils
  File "/usr/lib/python3.2/email/utils.py", line 27, in <module>
    import random
  File "/usr/lib/python3.2/random.py", line 45, in <module>
    from hashlib import sha512 as _sha512
ImportError: cannot import name sha512

I think that something with a python, is more true with libraries.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
abs0lut, 2015-12-15
@hottabxp

The site ex.ua lies.
Try a different URL.

A
Alexander, 2015-12-14
@NeiroNx

Yes, not all dependencies are satisfied for you - more precisely, the hashlib library is not fully installed (the program cannot find a number of child libraries).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question