CentOS7自带的python3下如何使用python3的pip

版权声明:欢迎大家进群交流,QQ群166477105, 所有非原创内容来自网络,如有侵权联系我删除 https://blog.csdn.net/weixin_43063753/article/details/86633885

虽说python3已经存在多年,可服务器系统组件多数还都是python2的。因此在CentOS7下,使用python3就要另外安装。

CentOS7自带了python3.4,yum install就可以了。

yum install python34 python34-pip python34-setuptools
安装完毕,系统就有了两套pip了,分别是pip2和pip3。

用python3的话,当然要pip3来安装包,但CentOS7下,自带的pip是python2的,执行pip3会出现异常。
普通用户执行pip3 install会提示没有权限写入系统目录,解决方法是,普通用户执行pip3 install,加个–user参数就可以了。

比如

python3 -m pip install xxxxx --upgrade --user
就这么简单。

yum install python36 python36-pip python36-setuptools

猜你喜欢

转载自blog.csdn.net/weixin_43063753/article/details/86633885
今日推荐