安装 Python 模块时出现问题

安装 Python 模块时出现问题

您好,我无法下载 python 模块 dm.smlsec.binding 1.0b3。我收到以下错误。我已附上日志文件,请帮我整理一下

------------------------------------------------------------
/usr/local/bin/pip run on Thu Jul 18 12:23:36 2013
Downloading/unpacking dm.xmlsec.binding
Running setup.py egg_info for package dm.xmlsec.binding
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/tmp/pip-build-student/dm.xmlsec.binding/setup.py", line 199, in <module>
    **setupArgs
  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 260, in __init__
  File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 284, in fetch_build_eggs
  File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 569, in resolve
    dist = best.get(req.key)
pkg_resources.VersionConflict: (lxml 2.3.2 (/usr/lib/python2.7/dist-packages), Requirement.parse('lxml>=3.0'))
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/tmp/pip-build-student/dm.xmlsec.binding/setup.py", line 199, in <module>
    **setupArgs
  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 260, in __init__
  File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/setuptools/dist.py", line 284, in fetch_build_eggs
  File "/usr/local/lib/python2.7/dist-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 569, in resolve
    dist = best.get(req.key)
pkg_resources.VersionConflict: (lxml 2.3.2 (/usr/lib/python2.7/dist-packages), Requirement.parse('lxml>=3.0'))
----------------------------------------

Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-student/dm.xmlsec.binding

Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1057, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/local/lib/python2.7/dist-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 236, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python2.7/dist-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 662, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-student/dm.xmlsec.binding

答案1

使用pip

安装 Python 包管理器:python-pip安装 python-pip

要安装最新的稳定版本,请运行

sudo pip install dm.xmlsec.binding

或者如果你需要特定版本:

sudo pip install dm.xmlsec.binding==1.0b3

与或相比,使用这种方法pip更受欢迎,因为它可以跟踪依赖项和更新,就像在 Ubuntu 上一样。easy_installsetup.pyapt

相关内容