1

pythonbrew を使用してカスタムビルドの python を含む debian パッケージを作成しようとしています。

コンパイルと debian の構築が成功しました。問題は、パッケージを他のマシンにインストールすると、一部のモジュールが機能しないことです。たとえば、hashlibまたは機能してos.getcwd()いません。一方、ビルドマシンではすべてが機能します。

Pythonのインストールを再配置することは可能ですか? 何が問題なのですか?

>>> 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

ディレクトリにビルドし、/opt/sw-python/extra/pythonbrewインストール時にpythonbrewが同じ/opt/sw-python/extra/pythonbrewディレクトリに配置されます。

対象マシン:

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

ビルドマシン:

Linux ds5vs5 2.6.32-5-amd64 ... 2012 x86_64 GNU/Linux
4

1 に答える 1

0

最後に、ビルド マシンと同様に、debian パッケージを別の Debian マシンにインストールしました。そしてそれは働いた!

正確な原因はわかりませんが、カーネルまたはコンパイラの違いだと思います。

于 2012-07-17T03:23:09.153 に答える