当前位置:   article > 正文

解决 Package 'setuptools' requires a different Python: 2.7.12 not in '>=3.5' 问题_error: package 'setuptools' requires a different p

error: package 'setuptools' requires a different python: 2.7.12 not in '>=3.

今天用virtualenv pip安装时报错
Package ‘setuptools’ requires a different Python: 2.7.12 not in ‘>=3.5’
在这里插入图片描述谷歌了才发现由于python2.7停止维护了,setuptools>=45的版本都不再支持python2.7。
但 virtualenv的pip还是默认地安装了setuptools的最新版本,需要手动设置setuptools版本<45
在这里指定一下版本号重新安装setuptools即可

(ven27) wnj@wnj:~/venvs$ pip install setuptools==44.0.0
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools==44.0.0
  Downloading setuptools-44.0.0-py2.py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 7.1 kB/s 
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 45.0.0
    Uninstalling setuptools-45.0.0:
      Successfully uninstalled setuptools-45.0.0
Successfully installed setuptools-44.0.0

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

后面再pip install其他包就不会报ERROR了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/570187
推荐阅读
相关标签
  

闽ICP备14008679号