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

Posted 网络虫

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python安装提示No module named setuptools,wget提示ERROR 403: SSL is required相关的知识,希望对你有一定的参考价值。

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

 

[[email protected] 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.

 

 

[[email protected] ~]# 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
#查看文件
[[email protected] ~]$ 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

以上是关于python安装提示No module named setuptools,wget提示ERROR 403: SSL is required的主要内容,如果未能解决你的问题,请参考以下文章

使用pip安装模块时提示: No module named pip

python运行提示缺少模块 No module named 'XX'

已经安装pillow还是提示No module named 'PIL'

Python报错No module named 'cv2'

pip安装第三方库时提示No Module named pip

Python 调用 xlrd和 xlwt,已经通过 pip 安装过了,但是在运行中提示:no module named xlwt/xlrd