pip 故障處理

來源:本站原創 Linux 超過1,110 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

———下面是排錯
[[email protected] ~]# 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

解決方法
[[email protected] ~]# yum install gcc

[[email protected] 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
[[email protected] Python-3.7.0]#

解決方法
安裝GCC軟件套件

[[email protected] ~]# yum install gcc

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文標題:pip 故障處理
本文鏈接:http://www.qdxgqk.live/?p=3859轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
?
?
萌宠夺宝游戏