python下setuptools的安装详解及No module named setuptools的解决方法

yipeiwu_com5年前Python基础

前言

python下的setuptools带有一个easy_install的工具,在安装python的每三方模块、工具时很有用,也很方便。

安装setuptools前先安装pip,请参考:linux下pip的安装步骤及使用详解

1. 下载:

在它的官网可以下载到安装包:

https://pypi.python.org/pypi/setuptools

页面最下面的是它的安装链接,如:

$wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-12.0.3.tar.gz#md5=f07e4b0f4c1c9368fcd980d888b29a65 

2. 安装

$ tar -zxvf setuptools-12.0.3.tar.gz
$ cd setuptools=12.0.3
$ python setup.py install

3. 出现错误提示:

Installed /usr/local/python2.7.3/lib/python2.7/site-packages/supervisor-4.0.0_dev-py2.7.egg
Processing dependencies for supervisor==4.0.0-dev
Searching for meld3>=1.0.0
Reading https://pypi.python.org/simple/meld3/
Download error on https://pypi.python.org/simple/meld3/: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed -- Some packages may not be found!
Couldn't find index page for 'meld3' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed -- Some packages may not be found!
No local packages or download links found for meld3>=1.0.0
error: Could not find suitable distribution for Requirement.parse('meld3>=1.0.0')

解决办法:

上网查询了问题原因: 是curl的证书太老了需要下载最新的证书:

下载最新的证书文件

$ wget http://curl.haxx.se/ca/cacert.pem 

更名为ca-bundle.crt放置到默认目录 

$ mv cacert.pem ca-bundle.crt 
$ mv ca-bundle.crt /etc/pki/tls/certs 

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对【听图阁-专注于Python设计】的支持。

相关文章

pyinstaller还原python代码过程图解

pyinstaller还原python代码过程图解

这篇文章主要介绍了pyinstaller还原python代码过程图解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 pyinstall...

用pandas按列合并两个文件的实例

用pandas按列合并两个文件的实例

直接上图,图文并茂,相信你很快就知道要干什么。 A文件: B文件: 可以发现,A文件中“汉字井号”这一列和B文件中“WELL”这一列的属性相同,以这一列为主键,把B文件中“TIME”...

使用Python3内置文档高效学习以及官方中文文档

概述 从前面的对Python基础知识方法介绍中,我们几乎是围绕Python内置方法进行探索实践,比如字符串、列表、字典等数据结构的内置方法,和大量内置的标准库,诸如functools、...

Python Sleep休眠函数使用简单实例

Python 编程中使用 time 模块可以让程序休眠,具体方法是time.sleep(秒数),其中“秒数”以秒为单位,可以是小数,0.1秒则代表休眠100毫秒。 复制代码 代码如下:...

python安装numpy&安装matplotlib& scipy的教程

python安装numpy&安装matplotlib& scipy的教程

numpy安装 下载地址:https://pypi.python.org/pypi/numpy(各取所需) copy安装目录。eg:鄙人的D:\python3.6.1\Scripts p...