在Python 3.3 Ubuntu中安装分发 [英] Installing distribute in Python 3.3 Ubuntu

查看:105
本文介绍了在Python 3.3 Ubuntu中安装分发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Ubuntu 12.04,并且已经安装了Python 3.3.1发行版.我想安装一些软件包,因此我首先尝试安装Distribution-0.6.38.在安装"阶段,我遇到以下运行时错误($ HOME是我的Python3.3安装位置):

File "$HOME/Python-3.3.1/Lib/zipfile.py", line 583, in _check_compression
  "Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module

我回溯了文件和函数调用,但无法确定为什么创建zipfile(我认为这是错误的根源)失败了.

包装中是否缺少某些物品?或者这是Python的辅助安装,是否存在问题?

解决方案

这是您从源代码安装Python的事实所致.

您需要安装zlib1g-dev软件包以提供Python的标头,以便能够在zlib支持中进行编译:

sudo apt-get install zlib1g-dev

您可能会缺少其他依赖项;如果要在Ubuntu机器上编译Python,这是我要安装的软件包的列表:

build-essential
libbz2-dev
libncursesw5-dev
libreadline5-dev
libssl-dev
libgdbm-dev
libc6-dev
libsqlite3-dev
tk-dev

I am running Ubuntu 12.04 and I have a distribution of Python 3.3.1 installed. I want to install some packages, so I first sought to install distribute-0.6.38. During the "install" phase, I am encountering the following runtime error ($HOME is the location of my Python3.3 installation):

File "$HOME/Python-3.3.1/Lib/zipfile.py", line 583, in _check_compression
  "Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module

I tracked back through the files and function calls, but cannot tell why the creation of the zipfile (I assume this is the root of the error) failed.

Is there something missing from the package? Or is there an issue with the fact that this is a secondary installation of Python?

解决方案

It is an issue with the fact you installed Python from source.

You need to install the zlib1g-dev package to provide the headers to Python to be able to compile in zlib support:

sudo apt-get install zlib1g-dev

You may be missing other dependencies; here is a list of packages I'd install if I were to compile Python on an Ubuntu machine:

build-essential
libbz2-dev
libncursesw5-dev
libreadline5-dev
libssl-dev
libgdbm-dev
libc6-dev
libsqlite3-dev
tk-dev

这篇关于在Python 3.3 Ubuntu中安装分发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆