Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Error SSL compiling with python (https)

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
rdpdo
Posts: 3
Joined: 2017-04-27 10:35

Error SSL compiling with python (https)

#1 Post by rdpdo »

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

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

Re: Error SSL compiling with python (https)

#2 Post by levlaz »

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

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

Re: Error SSL compiling with python (https)

#3 Post by rdpdo »

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 !

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Error SSL compiling with python (https)

#4 Post by dilberts_left_nut »

Code: Select all

ls -l /usr/bin/python*
?
AdrianTM wrote:There's no hacker in my grandma...

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

Re: Error SSL compiling with python (https)

#5 Post by rdpdo »

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 !

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Error SSL compiling with python (https)

#6 Post by debiman »

[quote="rdpdo"]

Code: Select all

(1:636)# python get-pip.py
ERROR:root:code for hash md5 was not found.[/quote]
don't be root when doing this.
DON'T be root when:
- building software
- interacting with network

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Error SSL compiling with python (https)

#7 Post by GarryRicketson »

dilberts_left_nut wrote:

Code: Select all

ls -l /usr/bin/python*
?
And what was the output of this command as requested ?

Post Reply