python-pip升级报错- AttributeError: 'NoneType' object has no attribute 'bytes'

正常的pip升级命令:

python -m pip install --upgrade pip

在pytharm里面创建了一个Python项目,pytharm会自动搭建一个新的Python环境,在当前的目录下
使用

python -m pip install --upgrade pip

会报错

AttributeError: ‘NoneType‘ object has no attribute ‘bytes‘

可以使用如下方式

easy_install -U pip

python-pip升级报错- AttributeError: 'NoneType' object has no attribute 'bytes'

原文地址:https://www.cnblogs.com/shiyongge/p/10279303.html

时间: 2024-07-30 03:35:27

python-pip升级报错- AttributeError: 'NoneType' object has no attribute 'bytes'的相关文章

Python - celery 相关报错 - AttributeError: type object '_multiprocessing.win32' has no attribute 'WAIT_OBJECT_0'

报错场景 执行   celery worker -A tasks -l INFO  打开 worker 的时候报错无法进行 报错解决 Celery 的版本过高, 进行降级处理即可 pip install celery==3.1.25 降级后再次执行会触发 另一报错 此报错原因是 redis 的版本过高导致 对 redis 进行降级即可  pip install redis==2.10.6 Python - celery 相关报错 - AttributeError: type object '_m

python jieba 结巴分词报错 AttributeError: 'module' object has no attribute 'cut'

首先这个AttributeError: ‘module’ object has no attribute ‘cut’ 报错的原因是因为有jieba.py这个文件存在,或者jieba这样命名的文件存在,很多新人使用结巴 来分词的时候命名直接为jieba.py,但是其实官方给的教程代码里有import jieba,这样就会引用到你自己这个教程文件jieba.py,而没有引用官方的库,这样自然cut这个方法就没有,所以报错.解决方法:1.不要使用jieba.py来命名你的测试文件.2.你一开始就是用j

Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attribute 'xxx'".这其实是.pyc文件存在问题. 问题定位: 查看import库的源文件,发现源文件存在且没有错误,同时存在源文件的.pyc文件 问题解决方法: 1. 命名py脚本时,不要与python预留字,模块名等相同 2. 删除该库的.pyc文件(因为py脚本每次运行时均会生成.pyc文件

facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: 'dict' object has no attribute 'iteritems'

报错原因:在进行facenet进行train_softmax.py训练时,在一轮训练结束进行验证时,报错AttributeError: 'dict' object has no attribute 'iteritems' 解决方案:由于我的python时3.5的,Python3.5中:iteritems变为items,找到train_softmax程序修改如下: facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: 'dict' obj

python框架Scrapy报错TypeError: 'float' object is not iterable解决

原因是:Twisted版本高了. 解决办法: 只要把Twisted库降级到16.6.0即可: 1 pip3 install Twisted==16.6.0 2 3 注:Twisted16.6.0安装后,会自动卸载高版本的Twisted python框架Scrapy报错TypeError: 'float' object is not iterable解决

python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdefaultencoding('utf-8') AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法: 1.python2中解决方法:reload(sys)sys.setdefaultencoding('utf-8'

Python python __def__ Exception AttributeError: "'NoneType' object has no attribute

class Person: '''Represents a person.''' population = 0 def __init__(self,name): '''Initializes the person's data.''' self.name = name print '(Initializing %s)' % self.name Person.population +=1 def __del__(self): '''I am dying.''' print '%s says bye

python提示AttributeError: 'NoneType' object has no attribute 'append'

在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.append(b) 执行一次后发现a的类型变为了NoneType. 下次执行时就会出现如题所示的错误. 把a = a.append(b)改为a.append(b)后问题解决. 原因:append会修改a本身,并且返回None.不能把返回值再赋值给a. python提示AttributeError: 'Non

python提示AttributeError: 'NoneType' object has no attribute 'append'【转发】

在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.append(b) 执行一次后发现a的类型变为了NoneType. 下次执行时就会出现如题所示的错误. 把a = a.append(b)改为a.append(b)后问题解决. 原因:append会修改a本身,并且返回None.不能把返回值再赋值给a.--------------------- 作者:冰雪凌萱