2017-01-23 1 views
0

루트 액세스 권한이없는 Linux 컴퓨터에 있습니다. 나는 openssl 및 python (2.7.13)의 자체 로컬 복사본을 만들었습니다. 내가 파이썬에서 hashlib을 가져올 때, 나는 이러한 오류 메시지를 얻을 :오류 : 루트 : 해시 md5 코드가 없습니다.

> python 
Python 2.7.13 (default, Jan 22 2017, 19:23:53) 
[GCC Intel(R) C++ gcc 4.8 mode] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import hashlib 
ERROR:root:code for hash md5 was not found. 
Traceback (most recent call last): 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 147, in <module> 
    globals()[__func_name] = __get_hash(__func_name) 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor 
    raise ValueError('unsupported hash type ' + name) 
ValueError: unsupported hash type md5 
ERROR:root:code for hash sha1 was not found. 
Traceback (most recent call last): 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 147, in <module> 
    globals()[__func_name] = __get_hash(__func_name) 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor 
    raise ValueError('unsupported hash type ' + name) 
ValueError: unsupported hash type sha1 
ERROR:root:code for hash sha224 was not found. 
Traceback (most recent call last): 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 147, in <module> 
    globals()[__func_name] = __get_hash(__func_name) 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor 
    raise ValueError('unsupported hash type ' + name) 
ValueError: unsupported hash type sha224 
ERROR:root:code for hash sha256 was not found. 
Traceback (most recent call last): 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 147, in <module> 
    globals()[__func_name] = __get_hash(__func_name) 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor 
    raise ValueError('unsupported hash type ' + name) 
ValueError: unsupported hash type sha256 
ERROR:root:code for hash sha384 was not found. 
Traceback (most recent call last): 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 147, in <module> 
    globals()[__func_name] = __get_hash(__func_name) 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor 
    raise ValueError('unsupported hash type ' + name) 
ValueError: unsupported hash type sha384 
ERROR:root:code for hash sha512 was not found. 
Traceback (most recent call last): 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 147, in <module> 
    globals()[__func_name] = __get_hash(__func_name) 
    File "/home/user_jp/srcMisc/Python-2.7.13/INSTALL/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor 
    raise ValueError('unsupported hash type ' + name) 
ValueError: unsupported hash type sha512 

UPDATE를 :

building '_hashlib' extension 
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/p/home/user_jp/srcMisc/Python-2.7.13/INSTALL/include -I. -IInclude -I./Include -I/usr/lo 
cal/include -I/p/home/user_jp/srcMisc/Python-2.7.13/Include -I/p/home/user_jp/srcMisc/Python-2.7.13 -c /p/home/user_jp/srcMisc/Python-2.7.13/Modules/_hashopenssl.c -o build/temp.linux-x8 
6_64-2.7/p/home/user_jp/srcMisc/Python-2.7.13/Modules/_hashopenssl.o 
In file included from /usr/include/openssl/asn1.h:74:0, 
       from /usr/include/openssl/objects.h:960, 
       from /usr/include/openssl/evp.h:98, 
       from /p/home/user_jp/srcMisc/Python-2.7.13/Modules/_hashopenssl.c:39: 
/p/home/apps/gmpapp/gcc_dir/platform/gcc-4.8.4/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/include-fixed/openssl/bn.h:610:1: error: unknown type name 'CRYPTO_THREADID' 
CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); 
^ 

나는이 문제를 해결하는 방법 : 난 그냥 파이썬 빌드가 hashlib 모듈을 구축하는 데 실패 실현 ? 문제는/usr/include/openssl에있는 openssl 헤더를 찾는 것일 수 있지만 내 자신의 openssl 설치를 사용하려고합니다.

답변

0

알아 냈어. python 빌드 스크립트는 /usr/include에서 openssl 헤더 파일을 찾습니다. 내 로컬 버전의 openssl을 설치 했으므로 해당 헤더 파일이 잘못되었습니다.

그래서 CFLAGS-i/location/correct/openssl/header/files으로 설정하고 make distclean을 구성하고 빌드하여 작동했습니다.

0

나는 이것을 OSX에서 vim으로 YouCompleteMe을 사용할 때 오류의 호스트 중 하나라고 생각했습니다. 마이그레이션 어시스턴트를 사용하여 한 Mac에서 다른 Mac으로 마이그레이션 한 후 였으므로 새로 설치하지 않았습니다. 내 경우에는 Anaconda python 배포판이 Homebrew를 망치고 있었기 때문입니다.

brew doctor로 알려 주시면 아나콘다가 홈브류에 문제를 일으킬 수 있습니다. 그래서 나는 다음 anaconda을 포함 이요 내 길의 일부가 실행 제거 :

brew uninstall macvim 
brew install macvim 
brew linkapps 

브루은 brew linkapps 좋은 명령 아니라고 불평하지만, 나를 위해 모두 같은 일을하고, 내 정력 오류가 멀리 갔다.

0

우분투 16.04에서 비슷한 문제가 발생했습니다. 밖으로 나가 포장을 필요로한다 libssl-dev.

(오류 : 루트 : 해시 md5의 코드를 찾을 수 없음)