• python安装提示No module named setuptools,wget提示ERROR 403: SSL is required


     在下载安装一个python工具时提示报错No module named setuptools

    [root@kermit supervisor-3.3.0]$ sudo python setup.py install
    Traceback (most recent call last):
      File "setup.py", line 32, in <module>
        from setuptools import setup, find_packages
    ImportError: No module named setuptools

         于是去下载setuptools工具,但遇到报错 ERROR 403: SSL is required.

    [root@kermit ~]# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
    --2017-11-03 11:20:16--  http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
    Resolving pypi.python.org... 151.101.72.223, 2a04:4e42:11::223
    Connecting to pypi.python.org|151.101.72.223|:80... connected.
    HTTP request sent, awaiting response... 403 SSL is required
    2017-11-03 11:20:16 ERROR 403: SSL is required.

        这时可能你会把它认为是要进行ssl证书检查的错误,可能会去尝试下面的命令,但发现仍然会报错。另外wget在安装的时候也有一项配置:./configure --with-ssl=openssl,这个配置会影响wget是否支持获取https的内容。

    sudo wget --no-check-certificate http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

        实际这个ERROR 403: SSL is required报错只是要求请求的URL一定要是https, 请求方自己没有做301转向处理。所以使用以下的命令即可。然后安装setuptools

    sudo wget  https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
    tar -xvf setuptools-0.6c11.tar.gz
    cd setuptools-0.6c11
    sudo python setup.py build
    sudo python setup.py install
    .....
    #如下标志安装成功
    Installed /usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
    Processing dependencies for setuptools==0.6c11
    Finished processing dependencies for setuptools==0.6c11
    #查看文件
    [root@kermit ~]$ ll /usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
    -rw-r--r-- 1 root root 333591 Nov  3 11:31 /usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
  • 相关阅读:
    认识Cookie和状态管理
    python之requests库使用问题汇总
    如何掌握所有的程序语言--王垠
    非 GUI 模式运行 JMeter 压力测试
    Python 如何将字符串转为字典
    python之operator操作符函数
    python3使用xlrd、xlwt、xlutils、openpyxl、xlsxwriter操作excel
    《敏捷软件测试:测试人员与敏捷团队的实践指南》
    Jmeter跨线程组传递变量
    Jmeter获取当前时间、历史时间、未来时间的方式
  • 原文地址:https://www.cnblogs.com/wangluochong/p/8724866.html
Copyright © 2020-2023  润新知