【问题标题】:Error SSL with python (https)错误 SSL 与 python (https)
【发布时间】:2017-04-26 19:49:02
【问题描述】:

我在 debian 8 下

我尝试安装:python-telegram-bot (https://github.com/python-telegram-bot/python-telegram-bot),但是当我执行“python setup.py install”时出错:

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!

所以我尝试使用 open-ssl 重新安装 python 2.7.13:

apt-get install opensll
apt-get install libssl-dev

我编辑了 /Modules/setup.dist :

# 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

之后,我运行 ./configure 并 make && make install

我有错误:安装过程中:

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

而 python-telegram-bot 不会编译 ...

有人能出主意吗?

非常感谢。 问候

【问题讨论】:

    标签: python ssl https debian python-telegram-bot


    【解决方案1】:

    我建议在安装 OpenSSL 后尝试重新安装 python2.7,正如以下 stackoverflow 答案中所建议的那样:

    https://stackoverflow.com/a/19926770/3826254

    或者干脆使用pip来安装python包。

    【讨论】:

      【解决方案2】:

      我在尝试从 source 安装 python2.7.13 时遇到了完全相同的错误。

      我尝试了很多东西,在花了很多时间后才知道libreadline6-dev 库中的一个丢失了。

      所以安装了它:

      sudo apt-get install libreadline6-dev
      

      对我来说效果很好。

      这是我用来编译和安装的命令(在 Python-2.7.13 目录中:

      ./configure --prefix /usr/bin/python2.7.13
      sudo make altinstall
      

      【讨论】:

        猜你喜欢
        • 2014-11-11
        • 1970-01-01
        • 2023-03-27
        • 2021-02-11
        • 2013-10-26
        • 1970-01-01
        • 2013-10-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多