码迷,mamicode.com
首页 > 编程语言 > 详细

python错误:distutils.errors.DistutilsError 解决方法

时间:2017-04-21 18:12:22      阅读:7265      评论:0      收藏:0      [点我收藏+]

标签:python

服务器安装protobuf-2.6.1包时,报错如下:

[root@host73 python]# python setup.py install

Download error on https://pypi.python.org/simple/google-apputils/: [Errno -2] Name or service

not known -- Some packages may not be found!

Couldn‘t find index page for ‘google-apputils‘ (maybe misspelled?)

Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known --

Some packages may not be found!

No local packages or download links found for google-apputils

Traceback (most recent call last):

File "setup.py", line 200, in <module>

"Protocol Buffers are Google‘s data interchange format.",

File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup

_setup_distribution = dist = klass(attrs)

File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__

self.fetch_build_eggs(attrs.pop(‘setup_requires‘))

File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs

parse_requirements(requires), installer=self.fetch_build_egg

File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve

dist = best[req.key] = env.best_match(req, self, installer)

File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match

return self.obtain(req, installer) # try and download/install

File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain

return installer(requirement)

File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg

return cmd.easy_install(req)

File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in

easy_install

raise DistutilsError(msg)

distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse

(‘google-apputils‘)


字面意思为:解析google-apputils,找不到合适的分布需求


解决办法:

安装google-apptuils包即可;

# yum install -y epel-release

# yum install python-pip

# pip install google-apputils

# python setup.py install

再次执行没有报错;


本文出自 “模范生的学习博客” 博客,请务必保留此出处http://mofansheng.blog.51cto.com/8792265/1918244

python错误:distutils.errors.DistutilsError 解决方法

标签:python

原文地址:http://mofansheng.blog.51cto.com/8792265/1918244

(2)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!