pip 故障处理 — CCIE那点事

pip 故障处理

来源:本站原创 Linux 超过33 views围观 0条评论

PIP可用安装方式
yum install python-setuptools && easy_install pip   #能用最好不能用就看下面
yum install gcc -y

下载python

  wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
解压
  tar zxvf Python-3.7.0.tgz
  cd Python-3.7.0
  ll
安装
  ./configure
  make && make install

下载pip
  wget https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz
  tar zxvf pip-1.5.4.tar.gz
  cd pip-1.5.4
安装 python setup.py install

———下面是排错
[root@host ~]# pip 
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point(‘pip==10.0.1’, ‘console_scripts’, ‘pip’)()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), [‘__name__’])
  File "/usr/lib/python2.6/site-packages/pip-10.0.1-py2.6.egg/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/usr/lib/python2.6/site-packages/pip-10.0.1-py2.6.egg/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/usr/lib/python2.6/site-packages/pip-10.0.1-py2.6.egg/pip/_internal/index.py", line 526
    {str(c.version) for c in all_candidates},
                      ^
SyntaxError: invalid syntax

解决方法
[root@localhost ~]# yum install gcc

[root@host Python-3.7.0]# ./configure
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for python3.7… no
checking for python3… no
checking for python… python
checking for –enable-universalsdk… no
checking for –with-universal-archs… no
checking MACHDEP… checking for –without-gcc… no
checking for –with-icc… no
checking for gcc… no
checking for cc… no
checking for cl.exe… no
configure: error: in `/root/Python-3.7.0′:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details
[root@host Python-3.7.0]#

解决方法
安装GCC软件套件

[root@localhost ~]# yum install gcc

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文标题:pip 故障处理
本文链接:http://www.jdccie.com/?p=3859转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点