Error SSL compiling with python (https)

If none of the more specific forums is the right place to ask

Error SSL compiling with python (https)

Postby rdpdo » 2017-04-27 10:47

Hello,

I am under debian 8.

I'd tried to install : python-telegram-bot (https://github.com/python-telegram-bot/ ... legram-bot) but when I did "python setup.py install" it make an error :

Code: Select all
Installed /usr/local/lib/python2.7/site-packages/python_telegram_bot-5.3.1-py2.7.egg
Processing dependencies for python-telegram-bot==5.3.1 Searching for certifi
Reading https://pypi.python.org/simple/certifi/
Download error on https://pypi.python.org/simple/certifi/: unknown url type: https -- Some packages may not be found!


So I have tried to re-install python 2.7.13 with open-ssl:

Code: Select all
apt-get install opensll
apt-get install libssl-dev


I edited the /Modules/setup.dist :
Code: Select all
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable: SSL=/usr/local/ssl
_ssl _ssl.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto


After that, I ran ./configure and make && make install

I have the error :during install :

Code: Select all
Makefile:1081: recipe for target 'libinstall' failed make: *** [libinstall]
Error 1


And python-telegram-bot would'n compile ...

Can someone have a idea ?

Thanks you very much. Regards
rdpdo
 
Posts: 3
Joined: 2017-04-27 10:35

Re: Error SSL compiling with python (https)

Postby levlaz » 2017-04-28 00:28

Is there a specific reason why you are installing it from source rather than via pip?

I would suggest using this method first:

Code: Select all
pip install python-telegram-bot --upgrade
Best,

Lev
Blog
User avatar
levlaz
 
Posts: 179
Joined: 2012-09-27 12:06
Location: San Francisco, CA

Re: Error SSL compiling with python (https)

Postby rdpdo » 2017-04-28 10:06

Hello, and thank you for your help but

When I try the commande :

Code: Select all
pip install python-telegram-bot --upgrade


I got the message :

Code: Select all
-bash: /usr/bin/pip: /usr/bin/python: bad interpreter: No such file or directory


I have installed pip whith
Code: Select all
apt-get install python-pip


I got the error message :

Code: Select all
Setting up python-pip (1.5.6-5) ...
/var/lib/dpkg/info/python-pip.postinst: /usr/bin/pycompile: /usr/bin/python: bad interpreter: No such file or directory
dpkg: error processing package python-pip (--configure):
 subprocess installed post-installation script returned error exit status 126
Errors were encountered while processing:
 python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)


I have also tried to install pip using :
Code: Select all
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py


But I have the error message :


Code: Select all
(1:636)# python get-pip.py
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "get-pip.py", line 20061, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/tmp/tmpGyRVbl/pip.zip/pip/__init__.py", line 21, in <module>
  File "/tmp/tmpGyRVbl/pip.zip/pip/_vendor/requests/__init__.py", line 62, in <module>
  File "/tmp/tmpGyRVbl/pip.zip/pip/_vendor/requests/packages/__init__.py", line 29, in <module>
ImportError: No module named urllib3



I have also tried to install python with apt-get install python but it does not solved my issues... I am trying to use pip / python / since 3 day ... :( If you have an idea ??
Thanks !
rdpdo
 
Posts: 3
Joined: 2017-04-27 10:35

Re: Error SSL compiling with python (https)

Postby dilberts_left_nut » 2017-04-28 10:28

Code: Select all
ls -l /usr/bin/python*
?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4556
Joined: 2009-10-05 07:54
Location: enzed

Re: Error SSL compiling with python (https)

Postby rdpdo » 2017-04-28 12:39

hello,

Well now I have thise error after dooing python get-pip.py
Code: Select all
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/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 "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 109, in __get_openssl_constructor
    return __get_builtin_constructor(name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "get-pip.py", line 20061, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/tmp/tmpONSspS/pip.zip/pip/__init__.py", line 21, in <module>
  File "/tmp/tmpONSspS/pip.zip/pip/_vendor/requests/__init__.py", line 62, in <module>
  File "/tmp/tmpONSspS/pip.zip/pip/_vendor/requests/packages/__init__.py", line 29, in <module>


I thonk it's beacause I cannot compile python with ssl... how to do this ??

Thanks !
rdpdo
 
Posts: 3
Joined: 2017-04-27 10:35

Re: Error SSL compiling with python (https)

Postby debiman » 2017-04-28 14:14

rdpdo wrote:[code](1:636)# python get-pip.py
ERROR:root:code for hash md5 was not found.

don't be root when doing this.
DON'T be root when:
- building software
- interacting with network
User avatar
debiman
 
Posts: 974
Joined: 2013-03-12 07:18

Re: Error SSL compiling with python (https)

Postby GarryRicketson » 2017-04-28 15:30

dilberts_left_nut wrote:
Code: Select all
ls -l /usr/bin/python*
?


And what was the output of this command as requested ?
User avatar
GarryRicketson
 
Posts: 3866
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Return to General Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable