AttributeError: ‘NoneType’ object has no attribute ‘bytes’
在PyCharm創建的Virtualenv環境下,使用pip安裝包時,老是提示需要升級pip,具體提示信息為:
You are using pip version 10.0.1, however version 19.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
而當執行完 python -m pip install --upgrade pip 后確報如下錯誤:
AttributeError: 'NoneType' object has no attribute 'bytes'
解決方法如下:
#這個方法我試了是可以的
1、python -m pip install -U --force-reinstall pip
2、python -m pip install -U pip
3、easy_install -U pip