Centos7 环境下搭建 python3 问题总结
- 系统默认是存在 python环境的 一般都是 2.7 版本 先检查
python2 -V
python3 -V
-
上传服务器解压
tar -zxvf +压缩包名
- 运行命令
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
- 完成之后,进入到解压后的安装包内,执行
./configure --prefix=你的安装路径
- 编译安装
make
make install
root用户运行 pip 命令问题
警告:WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
翻译
警告:以“root”用户运行pip可能导致权限损坏,并与系统包管理器发生冲突。建议使用虚拟环境:https://pip.pypa.io/warnings/venv
接触创建虚拟环境
python3 -m venv tutorial-env
source tutorial-env/bin/activate
然后继续执行自己的操作