解决办法--PyCharm安装python工具时提示No module named setuptools,安装setuptools时又提示ERROR 403: SSL is required

今天在Ubuntu下的PyCharm安装python工具时提示:

Traceback (most recent call last):
  File "/tmp/tmp1TAADfpycharm-management/pip-9.0.1/setup.py", line 6, in
    from setuptools import setup, find_packages
ImportError: No module named setuptools

于是根据提示去下载setuptools,但又遇到报错:

--2018-05-16 15:37:45--  http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
正在解析主机 pypi.python.org (pypi.python.org)... 151.101.40.223
正在连接 pypi.python.org (pypi.python.org)|151.101.40.223|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 403 SSL is required
2018-05-16 15:37:46 错误 403:SSL is required。

  最后了解到这个报错“错误 403:SSL is required”只是要求请求的网页地址一定要是https开头。于是我在http后面添加了一个s,就没有报错了,命令如下:

(1)下载setuptools包:

sudo wget  https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

(2)解压setuptools包

tar -xvf setuptools-0.6c11.tar.gz
(3)进入解压目录

cd setuptools-0.6c11

(4)编译setuptools

sudo python setup.py build
(5)最后执行setuptools安装

sudo python setup.py install
(6)安装成功后,最下面会出现类似于如下标志:
Installed /usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11


下载并安装完setuptools后,可以正常安装python工具

你可能感兴趣的:(Python)