WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python hashlib problem  (Read 3287 times)

Offline batnas

  • Full Member
  • ***
  • Posts: 122
python hashlib problem
« on: June 17, 2010, 06:52:40 AM »
Hi

I have a python-script (youtube-dl), that I will run in TC.
When the script tries to import hashlib.py, it fails with this error:
Code: [Select]
tc@box:/usr/local/bin$ /mnt/hda1/bin/youtube-dl http://www.youtube.com/watch?v=7
3dvrir5kig
Traceback (most recent call last):
  File "/mnt/hda1/bin/youtube-dl", line 22, in <module>
    import urllib2
  File "/usr/local/lib/python2.6/urllib2.py", line 93, in <module>
    import hashlib
  File "/usr/local/lib/python2.6/hashlib.py", line 136, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/usr/local/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
tc@box:/usr/local/bin$

I have installed python.tcz - I hink it is python version 2.6.5

Does anyone know how to solve this problem?

\\Batnas


EDIT:
after further investigation, it seems to me, that /usr/lib/python2.6/lib-dynload/_hashlib.so is missing
Is it correct?

Sorry, it was present
« Last Edit: June 17, 2010, 07:35:30 AM by batnas »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: python hashlib problem
« Reply #1 on: June 17, 2010, 11:00:04 AM »
I saw something similar - as I recall, either hashlib has been depreciated in favour of something else, or the md5 module has been depreciated by something else.

Does google help?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: python hashlib problem
« Reply #2 on: June 17, 2010, 11:13:45 AM »
I saw something similar - as I recall, either hashlib has been depreciated in favour of something else, or the md5 module has been depreciated by something else.

Does google help?


No need for Google, just documentation at www.python.org:

Quote
MD5 message digest algorithm
Deprecated since version 2.5: Use the hashlib module instead.

Quote
hashlib  — Secure hashes and message digests¶

New in version 2.5.

This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as RSA’s MD5 algorithm (defined in Internet RFC 1321). The terms secure hash and message digest are interchangeable. Older algorithms were called message digests. The modern term is secure hash.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline batnas

  • Full Member
  • ***
  • Posts: 122
Re: python hashlib problem
« Reply #3 on: June 17, 2010, 03:43:51 PM »
It works now.
I did nothing but restart...

\\Batnas