PyCharm中创建工程可以使用Virtualenv创建隔离的Python环境。正常来说,相关库的安装可以在PyCharm中File–>Settings–>Project Interpreter中进行,但通过这种方法进行pip的更新会报错,报错如下
AttributeError: 'NoneType' object has no attribute 'bytes'
解决方法:
首先删除现有的pip,工程目录下的Lib/site-packages/pip-*,然后在PyCharm中打开命令行,使用
easy_install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -U pip
进行pip的安装,其中-i指定安装的源,-U指定包名称。
本文地址:https://blog.csdn.net/qq_42497139/article/details/111147294
黄山市民网:https://www.huangshanshimin.com/