当前位置:   article > 正文

pip 安装软件排错_userwarning: unknown distribution option:

userwarning: unknown distribution option:
python-setuptools 与pip安装的setuptools只能有一个,如果有两个,默认使用系统安装的,所以你在用pip装软件的

   时候,很容易出现


   /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
  warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'tests_require'


  这个google出来是setup版本不对,所以要升级setuptools,但是如果有系统装了python-setuptools, 再使用pip install setuptools
  这样安装是不起作用的,需要先apt-get remove python-setuptools


因为


In [1]: import sys


In [2]: sys.path
Out[2]: 
['',
 '/usr/local/bin',
 '/vagrant_data',
 '/usr/local/lib/python2.7/dist-packages/amqp-1.4.6-py2.7.egg',
 '/usr/lib/python2.7/dist-packages',
 '/usr/local/lib/python2.7/dist-packages/pbr-0.10.0-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages/tox-1.8.1-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages/virtualenv-1.11.6-py2.7.egg',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/pymodules/python2.7',
 '/usr/local/lib/python2.7/dist-packages/IPython/extensions',
 '/root/.ipython']


In [3]: exit
root@test:/home/vagrant/download/tox-1.8.1# pip show setuptools
---
Name: setuptools
Version: 7.0
Location: /usr/local/lib/python2.7/dist-packages
Requires:


pip 装的包是在/usr/local/lib下,而系统装的是在 /usr/lib 下,系统装的包优先级别高,所有就算你装了,也不起作用, 所以等于说你机子上的

setuptools还是没有升级。 因此你需要先apt-get remove python-setuptools 然后再pip install setuptools.


本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/904108
推荐阅读
相关标签
  

闽ICP备14008679号