Using static-python
When I compile the binary (3.3.2 version), and run ./python
, if I import hashlib, I am receiving this error:
:akiva@akiva-ThinkPad-X230:~/Programming/Projects/youtube-downloader/static/static-python$ ./python
Python 3.3.2+ (default, Aug 4 2015, 03:07:14)
[GCC 4.9.2] on linux
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/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 91, 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/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 91, 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/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 91, 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/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 91, 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/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 91, 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/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/home/akiva/Programming/Projects/youtube-downloader/static/static-python/Lib/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
I used this command to compile:
make -f Static.make BUILTINS="_bisect _codecs_cn _codecs_hk _codecs_iso2022 _codecs_jp _codecs_kr _codecs_tw _collections _csv _ctypes _ctypes_test _elementtree _functools _hashlib _heapq _hotshot _io _json _locale _lsprof _multibytecodec _multiprocessing _random _socket _struct _testcapi array audioop binascii cmath crypt fcntl future_builtins grp itertools linuxaudiodev math mmap nis operator ossaudiodev parser pyexpat resource select spwd syslog termios time unicodedata zlib ssl atexit"
The main reason for so many modules is to make sure it is compatible with youtube-dl 's script.
This question seems to have the solution here:
Error importing hashlib with python 2.7 but not with 2.6
But this solution is not applicable obviously to a static version of python. Is this the solution I am looking for, and is there a way to link openssl while running my make command?