centos7安装Python3.6.5的步骤和异常处理

  1.  cd 到/tmp目录下
  2. wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz      ##下载包  
  3. tar -xzvf Python-3.6.6.tgz -C  /tmp                    ##解压
  4. cd Python-3.6.6/                                       ##进入
  5. ./configure --prefix=/usr/local   
  6. make
  7. make altinstall          
  8. ln -s /usr/local/bin/python3.6 /usr/bin/python3            ##Python建立软连接
  9. ln -s /usr/local/bin/pip3.6 /usr/bin/pip                         ##pip建立软连接

异常处理:

错误一:configure: error: in `Python-3.6.5': configure: error: no a     ### 缺少依赖包

可能用到的依赖包报上面的错运行一下下面的命令就好了

 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

错误二:zipimport.ZipImportError: can't decompress data; zlib not available
                                                                                make: *** [altinstall] Error 1

解决:yum -y install zlib*                  稍后继续执行

错误三:
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

这个错是缺少GCC软件套件

执行:yum install gcc       安装一下gcc套件就好了

猜你喜欢

转载自blog.csdn.net/mjp_erhuo/article/details/109747084
今日推荐