Question

I am trying to create a debian package containing customly built python using pythonbrew.

The compilation and debian construction is successfull. The problem is that when I install the package on other machine some modules does not work. For example hashlib or even os.getcwd() is not working. Whereas on build machine everything works.

Is it possible to relocate python installation? What might be the problem?

>>> from hashlib import md5
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/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 "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/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 "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/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 "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/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 "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/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 "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/opt/sw-python/extra/pythonbrew/pythons/Python-2.7.2/lib/python2.7/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 "<stdin>", line 1, in <module>
ImportError: cannot import name md5

I build it in /opt/sw-python/extra/pythonbrew directory and on install pythonbrew is placed to the same /opt/sw-python/extra/pythonbrew directory.

Target machine:

Linux german-pc 3.0.0-12-generic ... x86_64 x86_64 x86_64 GNU/Linux

Build machine:

Linux ds5vs5 2.6.32-5-amd64 ... 2012 x86_64 GNU/Linux
Was it helpful?

Solution

Finally, I installed my debian package on a different Debian machine similar to build machine. And it worked!

I don't know what exactly caused the problem, but I guess it's a difference in kernel or compiler.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top