一、setuptools安装错误:RuntimeError: Compression requires the (missing) zlib module

1. 描述

搞了个腾讯云的服务器,闲在手上没事准备当个测试机用用,写写代码什么的。然后按照之前写的文章安装了python2.7,安装的中途出现了一个错误:

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
running install
running bdist_egg
running egg_info
writing requirements to setuptools.egg-info/requires.txt
writing setuptools.egg-info/PKG-INFO
writing top-level names to setuptools.egg-info/top_level.txt
writing dependency_links to setuptools.egg-info/dependency_links.txt
writing entry points to setuptools.egg-info/entry_points.txt
reading manifest file "setuptools.egg-info/SOURCES.txt"
reading manifest template "MANIFEST.in"
warning: no files found matching "*" under directory "setuptools/_vendor"
writing manifest file "setuptools.egg-info/SOURCES.txt"
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying setuptools.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying setuptools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating "dist/setuptools-36.6.0-py2.7.egg" and adding "build/bdist.linux-x86_64/egg" to it
Traceback (most recent call last):
  File "setup.py", line 188, in <module>
    dist = setuptools.setup(**setup_params)
  File "/usr/local/python27/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/python27/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/python27/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/data/setuptools-36.6.0/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/data/setuptools-36.6.0/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command("bdist_egg")
  File "/usr/local/python27/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/local/python27/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/data/setuptools-36.6.0/setuptools/command/bdist_egg.py", line 231, in run
    dry_run=self.dry_run, mode=self.gen_header())
  File "/data/setuptools-36.6.0/setuptools/command/bdist_egg.py", line 473, in make_zipfile
    z = zipfile.ZipFile(zip_filename, mode, compression=compression)
  File "/usr/local/python27/lib/python2.7/zipfile.py", line 736, in __init__
    "Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module

其实错误一眼就能看出是缺少了zlib库,然后使用yum install zlib zlib-devel安装了库之后python setup.py install 发现还是一样报错。

2. 解决方法

装好zlib相关库之后把把python重新安装一遍,进入到源码目录:

 
1
2
yum install zlib zlib-devel
make && make install

二、setuptools错误:pkg_resources.DistributionNotFound: The "distribute==0.6.10" distribution was not found and is required by the application    [2017-10-21添加]

1. 描述

安装完setuptools准备使用时报错:

 
1
2
3
4
5
6
7
8
9
10
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in <module>
    from pkg_resources import load_entry_point
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3142, in <module>
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3126, in _call_aside
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 3155, in _initialize_master_working_set
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 666, in _build_master
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 679, in _build_from_requirements
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 867, in resolve
pkg_resources.DistributionNotFound: The "distribute==0.6.10" distribution was not found and is required by the application

2. 解决方法

缺少distribute模块,使用pip安装也装不上,需要在官网下载源码安装。

 
1
2
3
4
wget https://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
tar -zxvf distribute-0.6.10.tar.gz
cd distribute-0.6.10
python setup.py install

三、pip报错:pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.    [2017-10-21添加]

1. 错误描述

使用pip安装shadowsocks的时候报错:

 
1
2
3
4
5
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting shadowsocks
  Could not fetch URL https://pypi.python.org/simple/shadowsocks/: There was a problem confirming the ssl certificate: Can"t connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement shadowsocks (from versions: )
No matching distribution found for shadowsocks

2. 解决方法

系统缺少openssl-devel包,使用yum install openssl-devel安装。

然后重新安装python:进入python源码目录,make && make install,解决。

python安装途中遇到的问题和解决方法的更多相关文章

  1. Python: 安装 sklearn 包出现错误的解决方法

    今天在安装 Python 的 sklearn 包时出现了 Cannot uninstall 'numpy' 和 Cannot uninstall 'scipy' 错误,下面记录了我尝试了很多网上的方法 ...

  2. Ubuntu下 fatal error: Python.h: No such file or directory 解决方法

    参考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such file or ...

  3. 在CentOS7.1上安装Gitlab碰到的问题及解决方法

    一 前言 关于在CentOS7上安装Gitlab, 官方文档已经很详细了,步骤大家按照官方的安装文档一步一步安装即可, 这里就不在累述.官方安装文档地址:  https://about.gitlab. ...

  4. ASP.NET MVC 此安装不支持该项目类型解决方法

    http://www.cnblogs.com/younggun/archive/2011/03/03/1969498.html ASP.NET MVC  此安装不支持该项目类型解决方法 打开 .csp ...

  5. win7系统总是安装不了net2.0的解决方法

    一些网友询问说ghost win7系统总是安装不了net2.0怎么办呢?net2.0是什么?ATI显卡的控制中心 就需要在NET2.0的基础上.可是一些用户说win7系统总是安装不了net2.0如何解 ...

  6. mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))

    mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost')) 解决步骤: [====> ...

  7. win7 安装过程中遇到的错误解决方法

    win7 安装过程中遇到的错误解决方法 windows安装无法继续.若要安装windows 请单击 确定 重新启动计算机: 当 出现如上提示的时候,按下shift+f10 会打开命令窗口,进入到C:\ ...

  8. Linux安装ElasticSearch启动报错的解决方法

    Linux安装ElasticSearch后,ElasticSearch是不能用root用户启动的,以root用户启动会报错Refer to the log for complete error det ...

  9. STM32 USB转串口驱动安装不成功出现黄色感叹号解决方法!

    相信很多人在做USB转串口时出现过串口驱动安装不成功,出现黄色感叹号问题, 出现这种问题一般是驱动安装不成功造成的. 这里我就这个问题总结几个简单的方法. 方法1: 插上USB,利用驱动人生安装驱动. ...

随机推荐

  1. Service Account和其secrets 作用和场景,看了不亏。。

    Service Account概念的引入是基于这样的使用场景: 运行在pod里的进程需要调用Kubernetes API以及非Kubernetes API的其它服务.Service Account它并 ...

  2. thinkphp导出报表

    这是我写的一个方法,这个方法可以直接使用在你的代码上.下面我画红色的就是要修改或者删除的.public function import(){ /*创建PHPEXCLE读取,默认excel2007,最好 ...

  3. python中的注意事项

    .python 中的 and 从左到右计算表达式,若所有值均为真,则返回最后一个值,若存在假,返回第一个假值: or 也是从左到有计算表达式,返回第一个为真的值: 其中数字 0 是假,其他都是真: 字 ...

  4. hdu 1258

    Sum It Up Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total S ...

  5. dp练习(6)——搬运礼物

    3409 搬运礼物 CodeVS原创  时间限制: 1 s  空间限制: 64000 KB  题目等级 : 青铜 Bronze 题解       题目描述 Description 小浣熊松松特别喜欢交 ...

  6. 【转】jieba.NET与Lucene.Net的集成

    首先声明:我对Lucene.Net并不熟悉,但搜索确实是分词的一个重要应用,所以这里还是尝试将两者集成起来,也许对你有一参考. 看到了两个中文分词与Lucene.Net的集成项目:Lucene.Net ...

  7. spring boot 学习(五)SpringBoot+MyBatis(XML)+Druid

    SpringBoot+MyBatis(xml)+Druid 前言 springboot集成了springJDBC与JPA,但是没有集成mybatis,所以想要使用mybatis就要自己去集成. 主要是 ...

  8. bat批处理文件运行时隐藏cmd窗口

    想让bat运行时隐藏cmd窗口,最好的方法是使用vbs文件实现, 1.新建一个文本文档,改名为123.vbs,编辑内容: set ws=WScript.CreateObject("WScri ...

  9. MySQL 中Index Condition Pushdown (ICP 索引条件下推)和Multi-Range Read(MRR 索引多范围查找)查询优化

    一.ICP优化原理 Index Condition Pushdown (ICP),也称为索引条件下推,体现在执行计划的上是会出现Using index condition(Extra列,当然Extra ...

  10. 玩转X-CTR100 l STM32F4 l U-Blox NEO-6M GPS卫星定位-nmealib解码库移植解码

    我造轮子,你造车,创客一起造起来!塔克创新资讯[塔克社区 www.xtark.cn ][塔克博客 www.cnblogs.com/xtark/ ]      本文介绍X-CTR100控制器 扩展GPS ...